[PATCH v3 00/12] Enable lock context analysis

Bart Van Assche
2026-04-02T18:40:07Z

Hi Jens,

During the most recent merge window the following patch series has been merged:
[PATCH v5 00/36] Compiler-Based Context- and Locking-Analysis
(https://lore.kernel.org/lkml/20251219154418.3592607-1-elver@google.com/). That
patch series drops support for verifying lock context annotations with sparse
and introduces support for verifying lock context annotations with Clang. The
support in Clang for lock context annotation and verification is better than
that in sparse. As an example, __cond_acquires() and __guarded_by() are
supported by Clang but not by sparse. Hence this patch series that enables lock
context analysis for the block layer core and all block drivers.

Please consider this patch series for the next merge window.

Thanks,

Bart.

Changes compared to v2:
- Retained the block layer core patches and left out the block driver patches.
- Inlined blkg_conf_open_bdev_frozen() and blkg_conf_close_bdev_frozen().
- In blkg_conf_open_bdev(), added a return statement if the
WARN_ON_ONCE() statement triggers.
- Replaced the "block/ioctl: Add lock context annotations" patch with a
__release() annotation.
- Replaced the blk-zoned patch with a patch from Christoph.

Changes compared to v1:
- Rebased this patch series on top of Jens' for-next branch.
- Included two patches that split blkg_conf_prep() and blkg_conf_exit().
- Modified how patches are split. Split the block layer core patch into
multiple patches and moved the CONTEXT_ANALYSIS := y assignments into the
block driver patches.
- Made the new source code comments easier to comprehend.
- Introduced macros in the mq-deadline and Kyber I/O schedulers to make the
__acquires() expressions easier to read.
- Removed the changes from this series that are not block layer changes.

Bart Van Assche (11):
block: Annotate the queue limits functions
block/bdev: Annotate the blk_holder_ops callback invocations
block/cgroup: Split blkg_conf_prep()
block/cgroup: Split blkg_conf_exit()
block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen()
block/crypto: Annotate the crypto functions
block/blk-iocost: Add lock context annotations
block/blk-mq-debugfs: Improve lock context annotations
block/kyber: Make the lock context annotations compatible with Clang
block/mq-deadline: Make the lock context annotations compatible with
Clang
block: Enable lock context analysis

Christoph Hellwig (1):
block/blk-zoned: Refactor blkdev_zone_mgmt_ioctl()

block/Makefile | 2 +
block/bdev.c | 10 +++-
block/bfq-cgroup.c | 11 ++++-
block/blk-cgroup.c | 98 ++++++++++----------------------------
block/blk-cgroup.h | 13 +++--
block/blk-crypto-profile.c | 2 +
block/blk-iocost.c | 96 +++++++++++++++++++++++--------------
block/blk-iolatency.c | 19 ++++----
block/blk-mq-debugfs.c | 12 ++---
block/blk-throttle.c | 34 +++++++------
block/blk-zoned.c | 41 +++++++---------
block/blk.h | 4 ++
block/ioctl.c | 6 ++-
block/kyber-iosched.c | 7 ++-
block/mq-deadline.c | 12 +++--
include/linux/blkdev.h | 9 ++--
16 files changed, 195 insertions(+), 181 deletions(-)