Linux RCU subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Marco Elver <elver@google.com>,
	rcu@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>
Subject: [PATCH] srcu: Remove check from srcu_dereference_check()
Date: Fri,  1 May 2026 18:57:32 -0700	[thread overview]
Message-ID: <20260502015733.431424-1-bvanassche@acm.org> (raw)

Users of srcu_dereference_check() must hold either an SRCU reader lock
or hold the update-side lock. __srcu_read_lock_must_hold() checks
whether the SRCU reader lock is held. Since that check is too strict,
remove it.

Fixes: f0b7ce22d718 ("srcu: Support Clang's context analysis")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/linux/srcu.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 81b1938512d5..51864281164b 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -235,7 +235,6 @@ static inline void __srcu_read_lock_must_hold(const struct srcu_struct *ssp) __m
  */
 #define srcu_dereference_check(p, ssp, c)					\
 ({										\
-	__srcu_read_lock_must_hold(ssp);					\
 	__acquire_shared_ctx_lock(RCU);					\
 	__auto_type __v = __rcu_dereference_check((p), __UNIQUE_ID(rcu),	\
 				(c) || srcu_read_lock_held(ssp), __rcu);	\

             reply	other threads:[~2026-05-02  1:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-02  1:57 Bart Van Assche [this message]
2026-05-04 21:10 ` [PATCH] srcu: Remove check from srcu_dereference_check() Marco Elver

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=20260502015733.431424-1-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=elver@google.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.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