public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	John Ogness <john.ogness@linutronix.de>,
	Josh Triplett <josh@joshtriplett.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Waiman Long <longman@redhat.com>, Will Deacon <will@kernel.org>,
	Zqiang <qiang.zhang1211@gmail.com>
Subject: Re: [RFC PATCH] srcu: Use try-lock lockdep annotation for NMI-safe access.
Date: Thu, 28 Sep 2023 10:09:23 -0700	[thread overview]
Message-ID: <ZRWzQ5Fiav8aCYhj@boqun-archlinux> (raw)
In-Reply-To: <20230928152942.GE27245@noisy.programming.kicks-ass.net>

On Thu, Sep 28, 2023 at 05:29:42PM +0200, Peter Zijlstra wrote:
> On Thu, Sep 28, 2023 at 07:54:10AM -0700, Boqun Feng wrote:
> > On Thu, Sep 28, 2023 at 10:09:00AM +0200, Peter Zijlstra wrote:
> > > On Wed, Sep 27, 2023 at 11:06:09PM -0700, Boqun Feng wrote:
> > > 
> > > > I think this is a "side-effect" of commit f0f44752f5f6 ("rcu: Annotate
> > > > SRCU's update-side lockdep dependencies"). In verify_lock_unused(), i.e.
> > > > the checking for NMI lock usages, the logic is that
> > > 
> > > I think I'm having a problem with this commit -- that is, by adding
> > > lockdep you're adding tracepoint, which rely on RCU being active.
> > > 
> > > The result is that SRCU is now no longer usable from !RCU regions.
> > > 
> > 
> > Interesting
> > 
> > > Was this considered and intended?
> > > 
> > 
> > No, I don't think I have considered this before, I think I may still
> > miss something here, maybe you or Paul can provide an example for such
> > a case?
> 
> The whole trace_.*_rcuidle() machinery. Which I thought I had fully
> eradicated, but apparently still exists (with *one* user) :-/
> 
> Search for rcuidle in include/linux/tracepoint.h
> 
> Also, git grep trace_.*_rcuidle
> 

Thanks! But as I mentioned in the IRC, trace_.*_rcuidle() call the
special APIs srcu_read_{un,}lock_notrace(), and these won't call lockdep
annotation functions. And what the commit did was only changing the
lockdep annotation of srcu_read_{un,}lock(), so we are still fine here?

Regards,
Boqun

> 

      reply	other threads:[~2023-09-28 17:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 16:02 [RFC PATCH] srcu: Use try-lock lockdep annotation for NMI-safe access Sebastian Andrzej Siewior
2023-09-28  6:06 ` Boqun Feng
2023-09-28  6:33   ` Sebastian Andrzej Siewior
2023-09-28  8:05   ` Peter Zijlstra
2023-09-28  8:09   ` Peter Zijlstra
2023-09-28 14:54     ` Boqun Feng
2023-09-28 15:29       ` Peter Zijlstra
2023-09-28 17:09         ` Boqun Feng [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=ZRWzQ5Fiav8aCYhj@boqun-archlinux \
    --to=boqun.feng@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=john.ogness@linutronix.de \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /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