]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
locking/rwlock, spinlock: Support Clang's context analysis
authorMarco Elver <elver@google.com>
Fri, 19 Dec 2025 15:39:57 +0000 (16:39 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jan 2026 15:43:28 +0000 (16:43 +0100)
commitf16a802d402d735a55731f8c94952b3bbb5ddfe8
treec2c18a0e9a7d0794f07ade7416844c55f581f6b5
parent7c451541743c6c2ef1afc425191f18a23e311019
locking/rwlock, spinlock: Support Clang's context analysis

Add support for Clang's context analysis for raw_spinlock_t,
spinlock_t, and rwlock. This wholesale conversion is required because
all three of them are interdependent.

To avoid warnings in constructors, the initialization functions mark a
lock as acquired when initialized before guarded variables.

The test verifies that common patterns do not generate false positives.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251219154418.3592607-9-elver@google.com
12 files changed:
Documentation/dev-tools/context-analysis.rst
include/linux/rwlock.h
include/linux/rwlock_api_smp.h
include/linux/rwlock_rt.h
include/linux/rwlock_types.h
include/linux/spinlock.h
include/linux/spinlock_api_smp.h
include/linux/spinlock_api_up.h
include/linux/spinlock_rt.h
include/linux/spinlock_types.h
include/linux/spinlock_types_raw.h
lib/test_context-analysis.c