summaryrefslogtreecommitdiff
path: root/include/linux/pps_kernel.h
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2025-12-19 16:40:03 +0100
committerPeter Zijlstra <peterz@infradead.org>2026-01-05 16:43:30 +0100
commitfe00f6e84621ad441aa99005f2f0fefd0e5e1a2c (patch)
tree718ec6a56a46e0114137658d66095c7815fe41ef /include/linux/pps_kernel.h
parenteb7d96a13bf45f86909006a59e7855d8810f020a (diff)
rcu: Support Clang's context analysis
Improve the existing annotations to properly support Clang's context analysis. The old annotations distinguished between RCU, RCU_BH, and RCU_SCHED; however, to more easily be able to express that "hold the RCU read lock" without caring if the normal, _bh(), or _sched() variant was used we'd have to remove the distinction of the latter variants: change the _bh() and _sched() variants to also acquire "RCU". When (and if) we introduce context locks to denote more generally that "IRQ", "BH", "PREEMPT" contexts are disabled, it would make sense to acquire these instead of RCU_BH and RCU_SCHED respectively. The above change also simplified introducing __guarded_by support, where only the "RCU" context lock needs to be held: introduce __rcu_guarded, where Clang's context analysis warns if a pointer is dereferenced without any of the RCU locks held, or updated without the appropriate helpers. The primitives rcu_assign_pointer() and friends are wrapped with context_unsafe(), which enforces using them to update RCU-protected pointers marked with __rcu_guarded. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@kernel.org> Link: https://patch.msgid.link/20251219154418.3592607-15-elver@google.com
Diffstat (limited to 'include/linux/pps_kernel.h')
0 files changed, 0 insertions, 0 deletions