[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e4688d1-afe7-4508-9ebc-eeece0692365@paulmck-laptop>
Date: Fri, 28 Feb 2025 10:25:58 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Uladzislau Rezki <urezki@...il.com>
Cc: Boqun Feng <boqun.feng@...il.com>, RCU <rcu@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Cheung Wall <zzqq0103.hey@...il.com>,
Neeraj upadhyay <Neeraj.Upadhyay@....com>,
Joel Fernandes <joel@...lfernandes.org>,
Oleksiy Avramchenko <oleksiy.avramchenko@...y.com>
Subject: Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()
On Fri, Feb 28, 2025 at 06:08:19PM +0100, Uladzislau Rezki wrote:
> On Fri, Feb 28, 2025 at 05:36:47PM +0100, Uladzislau Rezki wrote:
> > On Fri, Feb 28, 2025 at 07:41:40AM -0800, Paul E. McKenney wrote:
> > > On Thu, Feb 27, 2025 at 06:44:15PM +0100, Uladzislau Rezki wrote:
> > > > On Thu, Feb 27, 2025 at 09:26:40AM -0800, Paul E. McKenney wrote:
> > > > > On Thu, Feb 27, 2025 at 09:12:39AM -0800, Boqun Feng wrote:
> > > > > > Hi Ulad,
> > > > > >
> > > > > > I put these three patches into next (and misc.2025.02.27a) for some
> > > > > > testing, hopefully it all goes well and they can make it v6.15.
> > > > > >
> > > > > > A few tag changed below:
> > > > > >
> > > > > > On Thu, Feb 27, 2025 at 02:16:13PM +0100, Uladzislau Rezki (Sony) wrote:
> > > > > > > Switch for using of get_state_synchronize_rcu_full() and
> > > > > > > poll_state_synchronize_rcu_full() pair to debug a normal
> > > > > > > synchronize_rcu() call.
> > > > > > >
> > > > > > > Just using "not" full APIs to identify if a grace period is
> > > > > > > passed or not might lead to a false-positive kernel splat.
> > > > > > >
> > > > > > > It can happen, because get_state_synchronize_rcu() compresses
> > > > > > > both normal and expedited states into one single unsigned long
> > > > > > > value, so a poll_state_synchronize_rcu() can miss GP-completion
> > > > > > > when synchronize_rcu()/synchronize_rcu_expedited() concurrently
> > > > > > > run.
> > > > > > >
> > > > > > > To address this, switch to poll_state_synchronize_rcu_full() and
> > > > > > > get_state_synchronize_rcu_full() APIs, which use separate variables
> > > > > > > for expedited and normal states.
> > > > > > >
> > > > > > > Link: https://lore.kernel.org/lkml/Z5ikQeVmVdsWQrdD@pc636/T/
> > > > > >
> > > > > > I switch this into "Closes:" per checkpatch.
> > > > > >
> > > > > > > Fixes: 988f569ae041 ("rcu: Reduce synchronize_rcu() latency")
> > > > > > > Reported-by: cheung wall <zzqq0103.hey@...il.com>
> > > > > > > Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
> > > > > >
> > > > > > You seem to forget add Paul's Reviewed-by, so I add it in rcu/next.
> > > > > > Would you or Paul double-check the Reviewed-by should be here?
> > > > >
> > > > > I am good with keeping my Reviewed-by tags.
> > > > >
> > > > Thanks Paul!
> > >
> > > Except that I got this from overnight testing of rcu/dev on the shared
> > > RCU tree:
> > >
> > > WARNING: CPU: 5 PID: 14 at kernel/rcu/tree.c:1636 rcu_sr_normal_complete+0x5c/0x80
> > >
> > > I see this only on TREE05. Which should not be too surprising, given
> > > that this is the scenario that tests it. It happened within five minutes
> > > on all 14 of the TREE05 runs.
> > >
> > Hm.. This is not fun. I tested this on my system and i did not manage to
> > trigger this whereas you do. Something is wrong.
> >
> We have below code to start a new GP, if we detect that processing is
> starved:
>
> <snip>
> /*
> * The "start_new_poll" is set to true, only when this GP is not able
> * to handle anything and there are outstanding users. It happens when
> * the rcu_sr_normal_gp_init() function was not able to insert a dummy
> * separator to the llist, because there were no left any dummy-nodes.
> *
> * Number of dummy-nodes is fixed, it could be that we are run out of
> * them, if so we start a new pool request to repeat a try. It is rare
> * and it means that a system is doing a slow processing of callbacks.
> */
> if (start_new_poll)
> (void) start_poll_synchronize_rcu();
> <snip>
>
> we do not use a _full() version, since we need to inform rcu-gp-kthread
> to initiate a new GP.
>
> Any thoughts?
My kneejerk not-to-be-trusted take is that it does not matter which type
of grace period gets started so long as a grace period does get started.
Presumably you have done the get_state_synchronize_rcu_full() before
this point?
Thanx, Paul
Powered by blists - more mailing lists