5–7 Oct 2026
Europe/Prague timezone

Compiler-Based Context Analysis for Compile-Time Lock Safety

5 Oct 2026, 10:30
30m
"South Hall 1 B" (Prague Congress Centre)

"South Hall 1 B"

Prague Congress Centre

158
Toolchains Track Toolchains Track

Speaker

Marco Elver (Google)

Description

Compiler-Based Context Analysis is a language extension which enables statically checking that required contexts are active (or inactive) by acquiring and releasing user-definable “context locks”. An obvious application of this feature is lock-safety checking for the kernel's various synchronization primitives, verifying at compile time that locking rules are not violated. This session will begin with a brief overview of this new infrastructure that relies on Clang's Thread Safety Analysis (-Wthread-safety), but the focus will be on how developers can use it to annotate locking requirements to catch concurrency bugs before they ever make it into a kernel binary.

Currently, the analysis is opt-in by default and requires declaring which modules and subsystems should be analyzed, as enabling it tree-wide currently results in numerous false positive warnings. In the remainder of the talk, we will discuss strategies and best practices on broadening Context Analysis coverage across the entire kernel tree.

Reference: https://docs.kernel.org/dev-tools/context-analysis.html

Author

Marco Elver (Google)

Co-author

Presentation materials

There are no materials yet.