Re: [PATCH RFC] rcu/nocb: Provide default all-CPUs mask for RCU_NOCB_CPU=y

From: Paul E. McKenney
Date: Mon Apr 11 2022 - 10:08:52 EST


On Fri, Apr 08, 2022 at 11:46:15PM +0200, Uladzislau Rezki wrote:
> >
> > Here is what I believe you are proposing:
> >
> >
> > --- rcu_nocbs rcu_nocbs=???
> >
> > CONFIG_RCU_NOCB_CPU_ALL=n [1] [2] [3]
> >
> > CONFIG_RCU_NOCB_CPU_ALL=y [4] [4] [3]
> >
> >
> > [1] No CPUs are offloaded at boot. CPUs cannot be offloaded at
> > runtime.
> >
> > [2] No CPUs are offloaded at boot, but any CPU can be offloaded
> > (and later de-offloaded) at runtime.
> >
> > [3] The set of CPUs that are offloaded at boot are specified by the
> > mask, represented above with "???". The CPUs that are offloaded
> > at boot can be de-offloaded and offloaded at runtime. The CPUs
> > not offloaded at boot cannot be offloaded at runtime.
> >
> > [4] All CPUs are offloaded at boot, and any CPU can be de-offloaded
> > and offloaded at runtime. This is the same behavior that
> > you would currently get with CONFIG_RCU_NOCB_CPU_ALL=n and
> > rcu_nocbs=0-N.
> >
> >
> > I am adding Frederic on CC, who will not be shy about correcting any
> > confusion I be suffering from have with respect to the current code.
> >
> > Either way, if this is not what you had in mind, what are you suggesting
> > instead?
> >
> > I believe that Steve Rostedt's review would carry weight for ChromeOS,
> > however, I am suffering a senior moment on the right person for Android.
> >
> We(in Sony) mark all CPUs as offloaded ones because of power reasons. The
> energy aware scheduler has a better knowledge where to place an rcuop/x
> task to invoke callbacks. The decision is taken based on many reason and
> the most important is to drain less power as a result of task placement.
> For example, power table, if OPP becomes higher or not, CPU is idle, etc.
>
> What Joel does in this patch sounds natural to me at least from the first
> glance. I mean converting the RCU_NOCB_CPU=y to make all CPUs to do offloading.

Just to be very clear, given appropriate acks/reviews, adding something
like CONFIG_RCU_NOCB_CPU_ALL to get default rcu_nocbs=0-N is fine.
However, Joel's original patch would not be good for the enterprise
distros, which rely on the current default.

Thanx, Paul