[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z7-DtSTSXOETcrnD@boqun-archlinux>
Date: Wed, 26 Feb 2025 13:12:21 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: Uladzislau Rezki <urezki@...il.com>
Cc: "Paul E . McKenney" <paulmck@...nel.org>, 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 v3 3/3] rcu: Use _full() API to debug synchronize_rcu()
On Wed, Feb 26, 2025 at 09:48:52PM +0100, Uladzislau Rezki wrote:
> Hello, Boqun.
>
> > Hi Ulad,
> >
> > On Tue, Feb 25, 2025 at 12:00:20PM +0100, Uladzislau Rezki (Sony) wrote:
> > > Switch for using of get_state_synchronize_rcu_full() and
> > > poll_state_synchronize_rcu_full() pair for 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 kernel splat.
> > >
> >
> > Could you provide detailed explanation on this? I.e. why is _full() is
> > needed? I find the current commit message is a bit vague.
> >
> <snip>
> rcu: Use _full() API to debug synchronize_rcu()
>
> 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.
> <snip>
>
> Does it look better?
>
Yes, that looks good to me. Thanks!
Regards,
Boqun
> --
> Uladzislau Rezki
>
Powered by blists - more mailing lists