Re: RCU vs NOHZ

From: Peter Zijlstra
Date: Thu Sep 29 2022 - 12:26:10 EST


On Thu, Sep 29, 2022 at 08:46:18AM -0700, Paul E. McKenney wrote:
> On Thu, Sep 29, 2022 at 08:20:44AM -0700, Paul E. McKenney wrote:

> > > > There is a directly invoked RCU hook for any transition that enables or
> > > > disables the tick, namely the ct_*_enter() and ct_*_exit() functions,
> > > > that is, those functions formerly known as rcu_*_enter() and rcu_*_exit().
> > >
> > > Context tracking doesn't know about NOHZ, therefore RCU can't either.
> > > Context tracking knows about IDLE, but not all IDLE is NOHZ-IDLE.
> > >
> > > Specifically we have:
> > >
> > > ct_{idle,irq,nmi,user,kernel}_enter()
> > >
> > > And none of them are related to NOHZ in the slightest. So no, RCU does
> > > not have a NOHZ callback.
> > >
> > > I'm still thikning you're conflating NOHZ_FULL (stopping the tick when
> > > in userspace) and regular NOHZ (stopping the tick when idle).
>
> Exactly how are ct_user_enter() and ct_user_exit() completely unrelated
> to nohz_full CPUs?

That's the thing; I'm not talking about nohz_full. I'm talking about
regular nohz. World of difference there.

nohz_full is a gimmick that shouldn't be used outside of very specific
cases. Regular nohz otoh is used by everybody always.