]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
locking/ww_mutex: Support Clang's context analysis
authorMarco Elver <elver@google.com>
Fri, 19 Dec 2025 15:40:09 +0000 (16:40 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jan 2026 15:43:32 +0000 (16:43 +0100)
commit47907461e4f6fcdce8cf91dd164369192deeb7c4
tree7bd6c1b08792910ec5d2eca8d236b28c0370862b
parentd3febf16dee28a74b01ba43195ee4965edb6208f
locking/ww_mutex: Support Clang's context analysis

Add support for Clang's context analysis for ww_mutex.

The programming model for ww_mutex is subtly more complex than other
locking primitives when using ww_acquire_ctx. Encoding the respective
pre-conditions for ww_mutex lock/unlock based on ww_acquire_ctx state
using Clang's context analysis makes incorrect use of the API harder.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251219154418.3592607-21-elver@google.com
Documentation/dev-tools/context-analysis.rst
include/linux/ww_mutex.h
lib/test_context-analysis.c