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

From: Peter Zijlstra
Date: Tue Feb 11 2020 - 10:31:44 EST


On Tue, Feb 11, 2020 at 07:06:15AM -0800, Paul E. McKenney wrote:
> And I have to ask... What happens if we are very early in from-idle
> NMI entry (or very late in NMI exit), such that both in_nmi() and
> rcu_is_watching() are returning false? Or did I miss a turn somewhere?

We must, by very careful inspection, ensure that doesn't happen.

No tracing must happen before preempt_count increment / after
preempt_count decrement. Otherwise we can no longer recover.