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

From: Paul E. McKenney
Date: Tue Feb 11 2020 - 08:23:17 EST


On Tue, Feb 11, 2020 at 02:16:37PM +0100, Peter Zijlstra wrote:
> On Tue, Feb 11, 2020 at 05:03:01AM -0800, Paul E. McKenney wrote:
>
> > > It is not the fact that perf issues rcu_read_lock() that is the problem.
> > > As we established yesterday, I can probably remove most rcu_read_lock()
> > > calls from perf today (yay RCU flavour unification).
> >
> > Glad some aspect of this unification is actually helping you. ;-)
>
> rcu_read_lock() is exceedingly cheap though, so I never really worried
> about it. But now that RCU includes RCU-sched (again) we can go and
> remove a bunch of them.
>
> > > As per nmi_enter() calling rcu_nmi_enter() I've always assumed that NMIs
> > > are fully covered by RCU.
> > >
> > > If this isn't so, RCU it terminally broken :-)
> >
> > All RCU can do is respond to calls to rcu_nmi_enter() and rcu_nmi_exit().
> > It has not yet figured out how to force people to add these calls where
> > they are needed. ;-)
> >
> > But yes, it would be very nice if architectures arranged things so
> > that all NMI handlers were visible to RCU. And we no longer have
> > half-interrupts, so maybe there is hope...
>
> Well,.. you could go back to simply _always_ watching :-)

The idle loop always was unwatched, even back in DYNIX/ptx. And watching
the idle loop requires waking up idle CPUs, which makes lots of people
quite unhappy. But it could be done with something sort of like
synchronize_rcu_tasks(), as long as this didn't need to be used in
production on battery-powered systems.

Thanx, Paul