summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPuranjay Mohan <puranjay@kernel.org>2026-07-06 10:27:41 -0700
committerPeter Zijlstra <peterz@infradead.org>2026-08-03 10:09:08 +0200
commitfa8a2d55139fb2e0b09e68c34b730adac92d18d6 (patch)
tree0ec9ddb86a3d60d2b33e32e561a62191571d7ced /include
parentcfd364903af769934ea92d5e80c9b8e20f7b48d2 (diff)
srcu: Add lock guard for srcu_fast_updown flavor
Add a guard(srcu_fast_updown) definition for scoped SRCU-fast-updown read-side critical sections, following the existing pattern of guard(srcu) and guard(srcu_fast). Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Link: https://patch.msgid.link/20260706172744.3920417-2-puranjay@kernel.org
Diffstat (limited to 'include')
-rw-r--r--include/linux/srcu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index a54ce9e808b9..72c86d3b23f2 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -638,4 +638,11 @@ DEFINE_LOCK_GUARD_1(srcu_fast_notrace, struct srcu_struct,
DECLARE_LOCK_GUARD_1_ATTRS(srcu_fast_notrace, __acquires_shared(_T), __releases_shared(*(struct srcu_struct **)_T))
#define class_srcu_fast_notrace_constructor(_T) WITH_LOCK_GUARD_1_ATTRS(srcu_fast_notrace, _T)
+DEFINE_LOCK_GUARD_1(srcu_fast_updown, struct srcu_struct,
+ _T->scp = srcu_read_lock_fast_updown(_T->lock),
+ srcu_read_unlock_fast_updown(_T->lock, _T->scp),
+ struct srcu_ctr __percpu *scp)
+DECLARE_LOCK_GUARD_1_ATTRS(srcu_fast_updown, __acquires_shared(_T), __releases_shared(*(struct srcu_struct **)_T))
+#define class_srcu_fast_updown_constructor(_T) WITH_LOCK_GUARD_1_ATTRS(srcu_fast_updown, _T)
+
#endif