Re: [PATCH v2] tracing: Make sure RCU is watching before calling a stack trace

From: Miroslav Benes
Date: Thu May 18 2017 - 09:49:10 EST


On Thu, 18 May 2017, Steven Rostedt wrote:

>
> From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>
>
> As stack tracing now requires "rcu watching", force RCU to be watching when
> recording a stack trace.
>
> Link: http://lkml.kernel.org/r/20170512172449.879684501@xxxxxxxxxxx
>
> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> ---
>
> Changes since v1:
>
> My testing discovered that the stack trace can be called with
> interrupts enabled, which is a no no to have when calling
> rcu_irq_enter(). When interrupts are enabled, as with being in an
> NMI, RCU will also be watching.

Would rcu_irq_enter_irqson() help then? This is what Petr used in a live
patching handler.

Your solution works too, of course. Just asking if I am not missing
something.

Thanks,
Miroslav