Re: [PATCH] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf trace point hook

From: Peter Zijlstra
Date: Tue Feb 11 2020 - 06:50:54 EST


On Mon, Feb 10, 2020 at 05:06:43PM -0500, Steven Rostedt wrote:
> + if (!rcu_watching) { \
> + /* Can not use RCU if rcu is not watching and in NMI */ \
> + if (in_nmi()) \
> + return; \
> + rcu_irq_enter_irqson(); \
> + } \

I saw the same weirdness in __trace_stack(), and I'm confused by it.

How can we ever get to: in_nmi() && !rcu_watching() ? That should be a
BUG. In particular, nmi_enter() has rcu_nmi_enter().

Paul, can that really happen?