Skip to content

Enable lock context analysis#724

Open
blktests-ci[bot] wants to merge 12 commits intolinus-master_basefrom
series/1067545=>linus-master
Open

Enable lock context analysis#724
blktests-ci[bot] wants to merge 12 commits intolinus-master_basefrom
series/1067545=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci bot commented Apr 3, 2026

Pull request for series with
subject: Enable lock context analysis
version: 3
url: https://patchwork.kernel.org/project/linux-block/list/?series=1076625

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 3, 2026

Upstream branch: d8a9a4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1076625
version: 3

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 7ca6d1c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1076625
version: 3

@blktests-ci blktests-ci bot force-pushed the series/1067545=>linus-master branch from 0e83bf5 to 1a5a045 Compare April 4, 2026 05:36
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from ed862bc to 2d0c3d5 Compare April 4, 2026 16:55
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 3aae938
series: https://patchwork.kernel.org/project/linux-block/list/?series=1076625
version: 3

@blktests-ci blktests-ci bot force-pushed the series/1067545=>linus-master branch from 1a5a045 to 2d202e3 Compare April 4, 2026 16:57
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 2d0c3d5 to 931d9b0 Compare April 8, 2026 10:29
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 8, 2026

Upstream branch: 3036cd0
series: https://patchwork.kernel.org/project/linux-block/list/?series=1076625
version: 3

@blktests-ci blktests-ci bot force-pushed the series/1067545=>linus-master branch from 2d202e3 to 942fce6 Compare April 8, 2026 10:31
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 931d9b0 to 78a4682 Compare April 10, 2026 00:51
Let the thread-safety checker verify whether every start of a queue
limits update is followed by a call to a function that finishes a queue
limits update.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
The four callback functions in blk_holder_ops all release the
bd_holder_lock. Add __release() annotations where appropriate to prepare
for enabling thread-safety analysis. Explicit __release() annotations have
been added since Clang does not support adding a __releases() annotation
to a function pointer.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Move the blkg_conf_open_bdev() call out of blkg_conf_prep() to make it
possible to add lock context annotations to blkg_conf_prep(). Change an
if-statement in blkg_conf_open_bdev() into a WARN_ON_ONCE() call. Export
blkg_conf_open_bdev() because it is called by the BFQ I/O scheduler and
the BFQ I/O scheduler may be built as a kernel module.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Split blkg_conf_exit() into blkg_conf_unprep() and blkg_conf_close_bdev()
because blkg_conf_exit() is not compatible with the Clang thread-safety
annotations. Remove blkg_conf_exit(). Rename blkg_conf_exit_frozen() into
blkg_conf_close_bdev_frozen(). Add thread-safety annotations to the new
functions.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
The blkg_conf_open_bdev_frozen() calling convention is not compatible
with lock context annotations. Inline both blkg_conf_open_bdev_frozen()
and blkg_conf_close_bdev_frozen() because these functions only have a
single caller. This patch prepares for enabling lock context analysis.

The type of 'memflags' has been changed from unsigned long into unsigned
int to match the type of current->flags. See also <linux/sched.h>.

Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Add the lock context annotations required for Clang's thread-safety
analysis.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 10, 2026

Upstream branch: 9a9c8ce
series: https://patchwork.kernel.org/project/linux-block/list/?series=1076625
version: 3

bvanassche and others added 6 commits April 10, 2026 09:56
Since iocg_lock() and iocg_unlock() both use conditional locking,
annotate both with __no_context_analysis and use token_context_lock() to
introduce a new lock context.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Make the existing lock context annotations compatible with Clang. Add
the lock context annotations that are missing.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Split the zone reset case into a separate helper so that the conditional
locking goes away.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
While sparse ignores the __acquires() and __releases() arguments, Clang
verifies these. Make the arguments of __acquires() and __releases()
acceptable for Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
…Clang

While sparse ignores the __acquires() and __releases() arguments, Clang
verifies these. Make the arguments of __acquires() and __releases()
acceptable for Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Now that all block/*.c files have been annotated, enable lock context
analysis for all these source files.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
@blktests-ci blktests-ci bot force-pushed the series/1067545=>linus-master branch from 942fce6 to d7cd01f Compare April 10, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants