Re: [PATCH RFC 6/4] srcu: Add guards for SRCU-fast readers
From: "Paul E. McKenney" <paulmck@kernel.org>
Date: 2025-07-17 19:51:30
Also in:
bpf, linux-rt-devel, rcu
On Thu, Jul 17, 2025 at 03:19:34PM -0400, Steven Rostedt wrote:
On Thu, 17 Jul 2025 12:04:46 -0700 "Paul E. McKenney" [off-list ref] wrote:quoted
This adds the usual scoped_guard(srcu_fast, &my_srcu) and guard(srcu_fast)(&my_srcu). Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Thank you! I will apply this on my next rebase. The normal process puts this into the v6.18 merge window, that it, the merge window after the upcoming one. If you need it sooner, please let us know. Thanx, Paul
-- Stevequoted
--- srcu.h | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 0aa2376cca0b1..ada65b58bc4c5 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h@@ -510,6 +510,11 @@ DEFINE_LOCK_GUARD_1(srcu, struct srcu_struct, srcu_read_unlock(_T->lock, _T->idx), int idx) +DEFINE_LOCK_GUARD_1(srcu_fast, struct srcu_struct, + _T->scp = srcu_read_lock_fast(_T->lock), + srcu_read_unlock_fast(_T->lock, _T->scp), + struct srcu_ctr __percpu *scp) + DEFINE_LOCK_GUARD_1(srcu_fast_notrace, struct srcu_struct, _T->scp = srcu_read_lock_fast_notrace(_T->lock), srcu_read_unlock_fast_notrace(_T->lock, _T->scp),