]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace/x86: Do no run CPU sync when there is only one CPU online
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 28 Mar 2017 13:58:21 +0000 (09:58 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 28 Mar 2017 16:35:16 +0000 (12:35 -0400)
commit692f7776a16cbad255bda4827ef5cea82c826fe3
tree39105b31b267b88a7182202327c5a4fc2c656952
parentfecfb566d20f0e170568ca35ecb5280718c1bf27
ftrace/x86: Do no run CPU sync when there is only one CPU online

Moving enabling of function tracing to early boot, even before scheduling is
enabled, means that it is not safe to enable interrupts. When function
tracing was enabled at boot up, it use to happen after scheduling and the
other CPUs were brought up. That required running a sync across all CPUs
when modifying the function hook locations in the code. To do the
synchronization, interrupts had to be enabled. Now function tracing can be
started before the other CPUs are brought up, and enabling interrupts in
that case is dangerous. As only tho boot CPU is active, there is no reason
to run the synchronization. If the online CPU count is one, do not bother
doing the synchronization. This removes the need to enable interrupts.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/kernel/ftrace.c