lkml.org 
[lkml]   [2021]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@kernel.org>
> > Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
> > Cc: Boqun Feng <boqun.feng@gmail.com>
> > Cc: Uladzislau Rezki <urezki@gmail.com>
> > Cc: Josh Triplett <josh@joshtriplett.org>
> > Cc: Joel Fernandes <joel@joelfernandes.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!

\
 
 \ /
  Last update: 2021-12-02 19:10    [W:0.076 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site