public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Boqun Feng <boqun.feng@gmail.com>,
	"Paul E . McKenney" <paulmck@kernel.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	RCU <rcu@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Cheung Wall <zzqq0103.hey@gmail.com>,
	Neeraj upadhyay <Neeraj.Upadhyay@amd.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: Re: [PATCH v3 3/3] rcu: Use _full() API to debug synchronize_rcu()
Date: Wed, 26 Feb 2025 21:48:52 +0100	[thread overview]
Message-ID: <Z79-NAOoK-Vimgbr@pc636> (raw)
In-Reply-To: <Z79kKiokpq9FpjYc@boqun-archlinux>

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?

--
Uladzislau Rezki


  reply	other threads:[~2025-02-26 20:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 11:00 [PATCH v3 1/3] rcutorture: Allow a negative value for nfakewriters Uladzislau Rezki (Sony)
2025-02-25 11:00 ` [PATCH v3 2/3] rcu: Update TREE05.boot to test normal synchronize_rcu() Uladzislau Rezki (Sony)
2025-02-25 11:00 ` [PATCH v3 3/3] rcu: Use _full() API to debug synchronize_rcu() Uladzislau Rezki (Sony)
2025-02-25 15:48   ` Paul E. McKenney
2025-02-25 16:30     ` Uladzislau Rezki
2025-02-26 18:57   ` Boqun Feng
2025-02-26 20:48     ` Uladzislau Rezki [this message]
2025-02-26 21:12       ` Boqun Feng
2025-02-25 21:24 ` [PATCH v3 1/3] rcutorture: Allow a negative value for nfakewriters Joel Fernandes
2025-02-26 14:29   ` Uladzislau Rezki
2025-02-26 14:50     ` Paul E. McKenney
2025-02-26 15:40       ` Uladzislau Rezki
2025-02-26 17:49     ` Joel Fernandes
2025-02-26 18:04       ` Paul E. McKenney
2025-02-26 18:16         ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z79-NAOoK-Vimgbr@pc636 \
    --to=urezki@gmail.com \
    --cc=Neeraj.Upadhyay@amd.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=zzqq0103.hey@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox