ftrace performance impact with different configuration
rostedt at goodmis.org
Fri Dec 30 17:25:41 EST 2011
On Fri, 2011-12-30 at 14:07 +0100, Philippe Rétornaz wrote:
> Sorry about being a bit naive, but why it is not possible to do it in two
> steps ?
> call stop_machine to put the jmp which skip the call to mcount
> Then wait until all tasks hits schedule() (synchronize_sched() ?)
Here's the problem. With a preemptible kernel, hitting schedule() does
not mean that you can guarantee that all tasks have not been
nop (use to be push lr)
end of interrupt
[ another processes is now running ]
put in push lr
put in call to mcount
everything seems to be running fine.
the low priority task gets scheduled again...
back at tail of return_from_intr in entry_64.S
pop lr (which was never pushed)
Now we jump back to some random stuff and the stack is corrupted.
There's no way to safely modify two instructions that depend on each
other in a preemptible kernel, with the exception of waiting for all
CPUs to hit idle (which may never happen on a busy system). And even
that may be racy.
> Then modify both instructions to put in place the two nops since we know that
> nobody is calling mcount.
More information about the linux-arm-kernel