From: Bradley Morgan <brads@mainlining.org>
To: kunwu.chan@gmail.com
Cc: jiangshanlai@gmail.com, josh@joshtriplett.org,
linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com,
paulmck@kernel.org, qiang.zhang@linux.dev, rcu@vger.kernel.org,
rostedt@goodmis.org
Subject: Re: [PATCH] srcutiny: Add lockdep and early-boot checks to synchronize_srcu_atomic()
Date: Fri, 11 Sep 2026 22:18:04 +0100 [thread overview]
Message-ID: <3CFBAB18-70BF-48DA-9CE2-77F7C89F2DCC@mainlining.org> (raw)
In-Reply-To: <20260911160913.2859713-1-kunwu.chan@gmail.com>
On 11 September 2026 17:09:13 BST, Kunwu Chan <kunwu.chan@gmail.com> wrote:
>Add the RCU_LOCKDEP_WARN and early-boot check that the Tree version
>gained, srcu_lock_sync() was already present.
>
>Suggested-by: Zqiang <qiang.zhang@linux.dev>
Ok.
Reviewed-by: Bradley Morgan <brads@mainlining.org>
>Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
>---
> kernel/rcu/srcutiny.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c
>index 99f8bfd98b04..76411562366f 100644
>--- a/kernel/rcu/srcutiny.c
>+++ b/kernel/rcu/srcutiny.c
>@@ -361,6 +361,12 @@ void synchronize_srcu_atomic(struct srcu_struct *ssp)
>
> srcu_lock_sync(&ssp->dep_map);
>
>+ RCU_LOCKDEP_WARN(lockdep_is_held(ssp),
>+ "Illegal synchronize_srcu_atomic() in same-type SRCU read-side critical section");
>+
>+ if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
>+ return;
>+
Wow!
> if (IS_ENABLED(CONFIG_PREEMPTION))
> synchronize_rcu(); // Needed for RCU Tasks Trace to imply RCU grace period.
> // And in Tiny RCU, it is near zero cost and doesn't block.
>
--- Thanks!
https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
next prev parent reply other threads:[~2026-09-11 21:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 16:09 [PATCH] srcutiny: Add lockdep and early-boot checks to synchronize_srcu_atomic() Kunwu Chan
2026-09-11 17:14 ` Paul E. McKenney
2026-09-11 21:18 ` Bradley Morgan [this message]
2026-09-11 23:12 ` Paul E. McKenney
2026-09-11 23:19 ` Bradley Morgan
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=3CFBAB18-70BF-48DA-9CE2-77F7C89F2DCC@mainlining.org \
--to=brads@mainlining.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kunwu.chan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.