Linux block layer
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH v6 00/14] Enable lock context analysis for the block layer core
Date: Tue,  2 Jun 2026 10:07:29 -0700	[thread overview]
Message-ID: <cover.1780419600.git.bvanassche@acm.org> (raw)

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/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.

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 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         | 302 ++++++++++++++++++++-----------------
 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, 291 insertions(+), 258 deletions(-)


             reply	other threads:[~2026-06-02 17:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 17:07 Bart Van Assche [this message]
2026-06-02 17:07 ` [PATCH v6 01/14] block: Annotate the queue limits functions Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 02/14] block/bdev: Annotate the blk_holder_ops callback functions Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 03/14] block/cgroup: Split blkg_conf_prep() Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 04/14] block/cgroup: Split blkg_conf_exit() Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 05/14] block/cgroup: Improve lock context annotations Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 06/14] block/blk-iocost: Combine two error paths in ioc_qos_write() Bart Van Assche
2026-06-03  1:46   ` Hannes Reinecke
2026-06-02 17:07 ` [PATCH v6 07/14] block/cgroup: Inline blkg_conf_{open,close}_bdev_frozen() Bart Van Assche
2026-06-03  1:47   ` Hannes Reinecke
2026-06-02 17:07 ` [PATCH v6 08/14] block/crypto: Annotate the crypto functions Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 09/14] block/blk-iocost: Split ioc_rqos_throttle() Bart Van Assche
2026-06-03  1:53   ` Hannes Reinecke
2026-06-02 17:07 ` [PATCH v6 10/14] block/blk-iocost: Inline iocg_lock() and iocg_unlock() Bart Van Assche
2026-06-03  1:59   ` Hannes Reinecke
2026-06-02 17:07 ` [PATCH v6 11/14] block/blk-mq-debugfs: Improve lock context annotations Bart Van Assche
2026-06-03  1:58   ` Hannes Reinecke
2026-06-02 17:07 ` [PATCH v6 12/14] block/Kyber: Make the lock context annotations compatible with Clang Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 13/14] block/mq-deadline: " Bart Van Assche
2026-06-02 17:07 ` [PATCH v6 14/14] block: Enable lock context analysis Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1780419600.git.bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hare@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox