[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211202181039.GD648659@lothringen>
Date: Thu, 2 Dec 2021 19:10:39 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Uladzislau Rezki <urezki@...il.com>,
Neeraj Upadhyay <quic_neeraju@...cinc.com>,
Boqun Feng <boqun.feng@...il.com>,
Josh Triplett <josh@...htriplett.org>,
Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org
Subject: Re: [PATCH 3/6] rcu/nocb: Optimize kthreads and rdp initialization
On Wed, Nov 24, 2021 at 04:30:26PM -0800, Paul E. McKenney wrote:
> On Tue, Nov 23, 2021 at 01:37:05AM +0100, Frederic Weisbecker wrote:
> > Currently cpumask_available() is used to prevent from unwanted
> > NOCB initialization. However if neither "rcu_nocbs=" nor "nohz_full="
> > parameters are passed but CONFIG_CPUMASK_OFFSTACK=n, the initialization
> > path is still taken, running through all sorts of needless operations
> > and iterations on an empty cpumask.
> >
> > Fix this with relying on a real initialization state instead. This
> > also optimize kthreads creation, sparing iteration over all online CPUs
> > when nocb isn't initialized.
> >
> > Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> > Cc: Neeraj Upadhyay <quic_neeraju@...cinc.com>
> > Cc: Boqun Feng <boqun.feng@...il.com>
> > Cc: Uladzislau Rezki <urezki@...il.com>
> > Cc: Josh Triplett <josh@...htriplett.org>
> > Cc: Joel Fernandes <joel@...lfernandes.org>
> > ---
> > kernel/rcu/tree_nocb.h | 24 +++++++++++++++++-------
> > 1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> > index e1cb06840454..d8ed3ee47a67 100644
> > --- a/kernel/rcu/tree_nocb.h
> > +++ b/kernel/rcu/tree_nocb.h
> > @@ -60,6 +60,9 @@ static inline bool rcu_current_is_nocb_kthread(struct rcu_data *rdp)
> > * Parse the boot-time rcu_nocb_mask CPU list from the kernel parameters.
> > * If the list is invalid, a warning is emitted and all CPUs are offloaded.
> > */
> > +
> > +static bool rcu_nocb_is_setup;
>
> I am taking this as is for now (modulo wordsmithing), but should this
> variable instead be in the rcu_state structure? The advantage of putting
> it there is keeping the state together. The corresponding disadvantage
> is that the state is globally visible within RCU.
>
> Thoughts?
Yes good point, will do!
Thanks!
Powered by blists - more mailing lists