]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lockdep: Annotate lockdep assertions for context analysis
authorMarco Elver <elver@google.com>
Fri, 19 Dec 2025 15:39:56 +0000 (16:39 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jan 2026 15:43:28 +0000 (16:43 +0100)
commit7c451541743c6c2ef1afc425191f18a23e311019
tree8808e9d483b66c232a30a44d0962946190827595
parent3931d4b980398012b66c8ff203bfa2ab3df71a71
lockdep: Annotate lockdep assertions for context analysis

Clang's context analysis can be made aware of functions that assert that
locks are held.

Presence of these annotations causes the analysis to assume the context
lock is held after calls to the annotated function, and avoid false
positives with complex control-flow; for example, where not all
control-flow paths in a function require a held lock, and therefore
marking the function with __must_hold(..) is inappropriate.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251219154418.3592607-8-elver@google.com
include/linux/lockdep.h