Re: RCU vs NOHZ

From: Paul E. McKenney
Date: Thu Sep 29 2022 - 12:36:33 EST


On Thu, Sep 29, 2022 at 06:18:32PM +0200, Peter Zijlstra wrote:
> On Thu, Sep 29, 2022 at 08:20:44AM -0700, Paul E. McKenney wrote:
>
> > > To recap; we want the CPU to go into deeper idle states, no?
> > >
> > > RCU can currently inhibit this by having callbacks pending for this CPU
> > > -- in this case RCU inhibits NOHZ-IDLE and deep power states are not
> > > selected or less effective.
> > >
> > > Now, deep idle states actually purge the caches, so cache locality
> > > cannot be an argument to keep the callbacks local.
> > >
> > > We know when we're doing deep idle we stop the tick.
> > >
> > > So why not, when stopping the tick, move the RCU pending crud elsewhere
> > > and let the CPU get on with going idle instead of inhibiting the
> > > stopping of the tick and wrecking deep idle?
> >
> > Because doing so in the past has cost more energy than is saved.
>
> How has this been tried; and why did the energy cost go up? Is this
> because the offload thread ends up waking up the CPU we just put to
> sleep?

Because doing the additional work consumes energy. I am not clear on
exactly what you are asking for here, given the limitations of the tools
that measure energy consumption.

> By default I think the offload stuff just doesn't work well for
> !NOHZ_FULL situations; that is, NOHZ_FULL is the only case where there
> are housekeeper CPUs that take care of the offload threads.
>
> Hence my initial suggestion to force the pending work into the jiffy
> owner CPU.

By all means, please feel free to prove me wrong. But doing so requires
real code and real testing of real energy consumption by real hardware
running real workloads.

It also requires correctly handling races with all and sundry.

Thanx, Paul