mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Fernandes <joelagnelf@nvidia.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Bradley Morgan <brads@mainlining.org>,
	qiang.zhang@linux.dev, boqun@kernel.org, frederic@kernel.org,
	linux-kernel@vger.kernel.org, neeraj.upadhyay@kernel.org,
	rcu@vger.kernel.org, urezki@gmail.com
Subject: Re: [PATCH] rcutorture: Fix suspicious rcu_dereference_check() usage for trivial-preempt
Date: Tue, 20 Oct 2026 18:20:09 -0400	[thread overview]
Message-ID: <20261020222009.GA1111073@joelbox> (raw)
In-Reply-To: <37881d14-7efe-4e03-8a92-6bd80c82b52f@paulmck-laptop>

On Tue, Oct 20, 2026 at 03:03:27PM -0700, Paul E. McKenney wrote:
> On Tue, Oct 20, 2026 at 03:01:27PM -0700, Paul E. McKenney wrote:
> > On Tue, Oct 20, 2026 at 04:06:49PM +0100, Bradley Morgan wrote:
> > > On 20 October 2026 10:49:07 BST, Zqiang <qiang.zhang@linux.dev> wrote:
> > > >Running the trivial-preempt flavor triggers a lockdep "suspicious RCU
> > > >usage" warning from rcu_torture_one_read_start():
> > > >
> > > >WARNING: suspicious RCU usage
> > > >kernel/rcu/rcutorture.c:2581 suspicious rcu_dereference_check() usage!
> > > >...
> > > >lockdep_rcu_suspicious
> > > >rcu_torture_one_read_start
> > > >rcu_torture_one_read
> > > >rcu_torture_reader
> > > >
> > > >The trivial-preempt flavor .readlock_held is set to
> > > >torture_readlock_not_held(),
> > > >which check RCU-bh/RCU-sched critical sections. however, it's read lock
> > > >just increments current->rcu_trivial_preempt_nesting, it's not also RCU
> > > >read critical sections. the rcu_dereference_check() condition is therefore
> > > >false, and lockdep report warnings. this commit therefore drop
> > > >.readlock_held
> > > >callback to avoid this lockdep warnings.
> > > >
> > > >Fixes: c6f4e552e1ea ("rcutorture: Add a textbook-style trivial preemptible RCU")
> > > 
> > > Looks ok to me.
> > > 
> > > Reviewed-by: Bradley Morgan <brads@mainlining.org>
> > > 
> > > >Signed-off-by: Zqiang <qiang.zhang@linux.dev>
> > 
> > And it works here, thank you both.  I have queued this, and thank you
> > Zqiang for thinking to test trivial-preempt with lockdep enabled!
> 
> Wait, Joel is doing the next merge window, not me!
> 
> Joel, please make that be:
> 
> Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> Tested-by: Paul E. McKenney <paulmck@kernel.org>
> 
> I will drop it from my tree, apologies for my confusion!

Applied for 7.5 for further testing, thanks!

thanks,

Joel Fernandes


      reply	other threads:[~2026-10-20 22:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  9:49 Zqiang
2026-10-20 15:06 ` Bradley Morgan
2026-10-20 22:01   ` Paul E. McKenney
2026-10-20 22:03     ` Paul E. McKenney
2026-10-20 22:20       ` Joel Fernandes [this message]

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=20261020222009.GA1111073@joelbox \
    --to=joelagnelf@nvidia.com \
    --cc=boqun@kernel.org \
    --cc=brads@mainlining.org \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=urezki@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

all inboxes | Powered by JetHome®