Skip to content

Enable lock context analysis for the block layer core

Bart Van Assche linux-block 8 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest14 patches 14 repliesApplied
  2. v614 patches 12 repliesSuperseded
  3. v512 patches 22 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v412 patches7 repliesSuperseded
v312 patches12 repliesSuperseded
v2 posting 2/226 patches32 repliesSuperseded
v2 posting 1/212 patches7 repliesSuperseded
v114 patches24 repliesSuperseded

Changes in v7 from the cover letter

- In patch 10/14, change guard()() back to spin_lock() calls.

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/14block: Annotate the queue limits functionsinclude/linux/blkdev.h+6 -31 reply
2/14block/bdev: Annotate the blk_holder_ops callback functionsinclude/linux/blkdev.h+8 -41 reply
3/14block/cgroup: Split blkg_conf_prep()block/bfq-cgroup.c block/blk-cgroup.c block/blk-iocost.c+16 -101 reply
4/14block/cgroup: Split blkg_conf_exit()block/bfq-cgroup.c block/blk-cgroup.c block/blk-cgroup.h +3 more+101 -911 reply
5/14block/cgroup: Improve lock context annotationsblock/blk-cgroup.c block/blk-cgroup.h+10 -61 reply
6/14block/blk-iocost: Combine two error paths in ioc_qos_write()block/blk-iocost.c+7 -71 reply
7/14block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen()block/blk-cgroup.c block/blk-cgroup.h block/blk-iocost.c+19 -561 reply
8/14block/crypto: Annotate the crypto functionsblock/blk-crypto-profile.c+2 -00 replies
9/14block/blk-iocost: Split ioc_rqos_throttle()block/blk-iocost.c+94 -691 reply
10/14block/blk-iocost: Inline iocg_lock() and iocg_unlock()block/blk-iocost.c+26 -271 reply
11/14block/blk-mq-debugfs: Improve lock context annotationsblock/blk-mq-debugfs.c block/blk.h+22 -61 reply
12/14block/Kyber: Make the lock context annotations compatible with Clangblock/kyber-iosched.c+5 -21 reply
13/14block/mq-deadline: Make the lock context annotations compatible with Clangblock/mq-deadline.c+8 -41 reply
14/14block: Enable lock context analysisblock/Makefile+2 -01 reply

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigHannes ReineckeChaitanya Kulkarni
1/14R-b R-b R-b R-b R-b
2/14R-b R-b R-b
3/14R-b R-b R-b
4/14R-b R-b R-b
5/14R-b R-b R-b
6/14R-b R-b R-b
7/14R-b R-b R-b
8/14R-b R-b
9/14R-b R-b R-b
10/14R-b
11/14R-b R-b R-b
12/14R-b R-b R-b
13/14R-b R-b R-b
14/14R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v7 thread

Cover letter [PATCH v7 00/14] Enable lock context analysis for the block layer core

Hi Jens,

Recently the following patch series has been merged: [PATCH v5 00/36] Compiler-Based Context- and Locking-Analysis
(https://lore.kernel.org/lkml/[email protected]/). 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.

Note: although the Linux kernel documentation specifies 22 as minimal version for Clang for context analysis support, this patch series requires Clang 23 because it annotates function pointers. As one can see here, a patch has been queued that fixes the kernel documentation:
https://lore.kernel.org/all/177926568868.711.3058599932884307249.tip-bot2@tip-bot2/

Please consider this patch series for the next merge window.

Thanks,

Bart.

Changes compared to v6:
- In patch 10/14, change guard()() back to spin_lock() calls.

Changes compared to v5:
- Made the description of patch "block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen()" more clear.
- Combined two error paths in ioc_qos_write().
- Folded iocg_lock() and iocg_unlock() into their callers. Removed the token context lock "ioc_lock".
- Introduced macros in the debugfs code that capture expressions with pointer casts.
- Added two patches: "block/blk-iocost: Combine two error paths in ioc_qos_write()" and "block/blk-iocost: Split ioc_rqos_throttle()".

Changes compared to v4:
- Rebased and retested on top of Jens' latest for-next branch.

Changes compared to v3:
- Replaced the "block/bdev: Annotate the blk_holder_ops callback invocations" patch with a patch that adds __releases() annotations to the function pointers in struct blk_holder_ops.
- Dropped the blk-zoned patch since a better patch from Christoph has been merged.

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 (14):
block: Annotate the queue limits functions
block/bdev: Annotate the blk_holder_ops callback functions block/cgroup: Split blkg_conf_prep()
block/cgroup: Split blkg_conf_exit()
block/cgroup: Improve lock context annotations block/blk-iocost: Combine two error paths in ioc_qos_write() block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen() block/crypto: Annotate the crypto functions block/blk-iocost: Split ioc_rqos_throttle() block/blk-iocost: Inline iocg_lock() and iocg_unlock() 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

 block/Makefile             |   2 +
 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         | 306 +++++++++++++++++++++----------------
 block/blk-iolatency.c      |  19 ++-
 block/blk-mq-debugfs.c     |  24 ++-
 block/blk-throttle.c       |  34 +++--
 block/blk.h                |   4 +
 block/kyber-iosched.c      |   7 +-
 block/mq-deadline.c        |  12 +-
 include/linux/blkdev.h     |  21 ++-
 13 files changed, 297 insertions(+), 256 deletions(-)