From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: paulmck@kernel.org
Cc: Puranjay Mohan <puranjay@kernel.org>,
linux-kernel@vger.kernel.org, Boqun Feng <boqun@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joelagnelf@nvidia.com>,
Uladzislau Rezki <urezki@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>,
Linus Torvalds <torvalds@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
Christian Brauner <brauner@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Liam R . Howlett" <liam@infradead.org>,
Lorenzo Stoakes <ljs@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
Andrew Ballance <andrewjballance@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
rcu@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>
Subject: Re: [RFC PATCH 00/12] RCU pseudo-transactions
Date: Tue, 10 Nov 2026 10:26:24 -0500 [thread overview]
Message-ID: <cf8bf913-1bf9-49d6-9749-8631cee1604f@efficios.com> (raw)
In-Reply-To: <3cb75140-1d10-4de3-86e6-c9d70edd2da5@paulmck-laptop>
On 2026-11-09 20:34, Paul E. McKenney wrote:
[...]
>> Would you prefer to add these two variants on the SRCU side, or should
>> I prototype them with the next version of this series?
>
> Your choice!
I'll do it. Adapting atomic SRCU to these needs is much more
maintainable than keeping my own copy of nearly the same mechanism.
> If you would like to do it, the trick is to make srcu_read_lock_atomic()
> and srcu_read_unlock_atomic() invoke __srcu_read_lock_fast() and
> __srcu_read_unlock_fast(), respectively, instead of __srcu_read_lock()
> and __srcu_read_unlock(), again respectively.
I'll start by making every atomic reader NMI-safe this way, as you
suggest. If David objects, we can still change it based on his
feedback.
> Then there would need to be an srcu_read_lock_atomic_irqsafe() and
> srcu_read_unlock_irqrestore(), which would (as you say), replace
> preempt_disable() with local_irq_save() and preempt_enable()
> with local_irq_restore(). There would be a flags argument that
> as far as I know requires srcu_read_lock_atomic_irqsafe() and
> srcu_read_unlock_irqrestore() be macros. It would be good to share code
> with srcu_read_lock_atomic() and srcu_read_unlock_atomic().
Agreed. I plan to name them srcu_read_lock_atomic_irqsave() and
srcu_read_unlock_atomic_irqrestore(), as macros sharing code with the
current pair.
> And kernel/rcu/rcutorture.c would need a bit of tweaking to test
> this new interface, which should be discoverable by looking for
> the code that tests srcu_read_{,un}lock_atomic(). Maybe just make
> srcu_torture_read_lock() randomly decide between srcu_read_lock_atomic()
> and srcu_read_lock_atomic_irqsave(), and have srcu_torture_read_unlock()
> follow that decision.
>
> One potentially tricky part here is that rcutorture is not set up to
> pass a flags variable from a read-lock to the corresponding read-unlock.
I'll look at the rcutorture side as part of it.
A later version of rcu_txn will then use these readers, instead of its
own per-CPU counters.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2026-11-10 15:26 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 13:33 Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 01/12] rcu_txn: Add single-writer " Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:11 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 02/12] rcu_txn: Add KUnit tests Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 03/12] rcu_txn: Skip the record lookup with a Bloom filter Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:12 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 04/12] rcu_txn: Add CONFIG_DEBUG_RCU_TXN Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:12 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 05/12] rcu_txn: Add an hlist edited through transactions Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:12 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 06/12] rcu_txn: Add a doubly-linked list coherent in both directions Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:13 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 07/12] Documentation/RCU: Describe RCU pseudo-transactions Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 08/12] Documentation/litmus-tests: Add RCU pseudo-transaction tests Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 09/12] rcu_txn: Test a list writer against concurrent readers Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:13 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 10/12] rcu_txn: Test a commit from atomic context Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:14 ` Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 11/12] samples: Add a cache on RCU pseudo-transactions under one mutex Mathieu Desnoyers
2026-10-16 13:33 ` [RFC PATCH 12/12] samples: Add a cache on RCU pseudo-transactions with a lock per node Mathieu Desnoyers
2026-10-23 18:22 ` Puranjay Mohan
2026-11-10 15:14 ` Mathieu Desnoyers
2026-10-19 0:55 ` [RFC PATCH 00/12] RCU pseudo-transactions Joel Fernandes
2026-10-23 13:37 ` Mathieu Desnoyers
2026-10-23 18:19 ` Puranjay Mohan
2026-10-27 19:57 ` Mathieu Desnoyers
2026-10-28 1:13 ` Mathieu Desnoyers
2026-11-10 0:25 ` Paul E. McKenney
2026-11-10 1:00 ` Mathieu Desnoyers
2026-11-10 1:34 ` Paul E. McKenney
2026-11-10 15:26 ` Mathieu Desnoyers [this message]
2026-11-10 15:11 ` Mathieu Desnoyers
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=cf8bf913-1bf9-49d6-9749-8631cee1604f@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=aliceryhl@google.com \
--cc=andrewjballance@gmail.com \
--cc=boqun@kernel.org \
--cc=brauner@kernel.org \
--cc=dwmw2@infradead.org \
--cc=frederic@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=puranjay@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=urezki@gmail.com \
--cc=will@kernel.org \
--cc=willy@infradead.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
all inboxes | Powered by JetHome®