Re: [PATCH 2/5] rcu/nocb: Move rcu_nocb_is_setup to rcu_state

From: Paul E. McKenney
Date: Thu Feb 17 2022 - 00:31:20 EST


On Wed, Feb 16, 2022 at 05:53:32PM -0800, Paul E. McKenney wrote:
> On Wed, Feb 16, 2022 at 01:30:35PM -0800, Paul E. McKenney wrote:
> > On Wed, Feb 16, 2022 at 04:42:05PM +0100, Frederic Weisbecker wrote:
> > > In order to avoid scattering the global RCU states, move the RCU nocb
> > > initialization witness within rcu_state.
> > >
> > > Reported-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> > > Cc: Neeraj Upadhyay <quic_neeraju@xxxxxxxxxxx>
> > > Cc: Uladzislau Rezki <uladzislau.rezki@xxxxxxxx>
> > > Cc: Joel Fernandes <joel@xxxxxxxxxxxxxxxxx>
> > > Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
> > > Signed-off-by: Frederic Weisbecker <frederic@xxxxxxxxxx>
> >
> > Build testing for CONFIG_NO_HZ_FULL=n kernels suggested the following
> > patch be merged into this one. Or does this variable need to be used
> > somewhere? Either way, please let me know!
>
> TASKS03, TREE04, and TREE07 don't like this much, according to git
> bisect. They are the ones with nohz_full CPUs, in case that is crucial.
> Trying again after reverting this commit locally.
>
> If that works, I would be tempted to try the modification shown below.

And that does pass significant rcutorture testing, but over to you. ;-)

Thanx, Paul

> > ------------------------------------------------------------------------
> >
> > commit 1a4f308b3b3841ef10043fe6c3dd12fc872b0400
> > Author: Paul E. McKenney <paulmck@xxxxxxxxxx>
> > Date: Wed Feb 16 13:27:42 2022 -0800
> >
> > squash! rcu/nocb: Move rcu_nocb_is_setup to rcu_state
> >
> > [ paulmck: Remove unused need_rcu_nocb_mask local variable. ]
> >
> > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> >
> > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> > index 9d6d4786bc703..9d97aa1f4d6ce 100644
> > --- a/kernel/rcu/tree_nocb.h
> > +++ b/kernel/rcu/tree_nocb.h
> > @@ -1154,14 +1154,8 @@ EXPORT_SYMBOL_GPL(rcu_nocb_cpu_offload);
> > void __init rcu_init_nohz(void)
> > {
> > int cpu;
> > - bool need_rcu_nocb_mask = false;
> > struct rcu_data *rdp;
> >
> > -#if defined(CONFIG_NO_HZ_FULL)
> > - if (tick_nohz_full_running && !cpumask_empty(tick_nohz_full_mask))
> > - need_rcu_nocb_mask = true;
>
> rcu_state.nocb_is_setup = true;
>
> > -#endif /* #if defined(CONFIG_NO_HZ_FULL) */
> > -
> > if (rcu_state.nocb_is_setup) {
> > if (!cpumask_available(rcu_nocb_mask)) {
> > if (!zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL)) {