Re: Re: [RFC PATCH 0/2] kpatch: dynamic kernel patching

From: Masami Hiramatsu
Date: Thu May 01 2014 - 21:31:14 EST


(2014/05/02 6:06), Andi Kleen wrote:
>> When bar returns, would it skip foo and go straight back to foo's
>> caller? If so, then it should be safe to patch foo after it jumps to
>> bar.
>
> foo is no problem, you see it in the backtrace.
> But you don't see bar.

No, there is no "foo" in backtrace.
As Josh said, stop_machine() schedules highest priority tasks on
each running thread, as below.

buz:
...
call foo -> push buz on the stack

foo:
...
jmp bar

bar:
...
call schedule -> push bar on the stack

Thus, we'll not see foo on the stack. However, since the tail call
doesn't return to foo, we can treat it already finished. So, there
is no consistency problem on it. :)

Thank you,

--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/