Enable lock context analysis#724
Open
blktests-ci[bot] wants to merge 12 commits intolinus-master_basefrom
Open
Enable lock context analysis#724blktests-ci[bot] wants to merge 12 commits intolinus-master_basefrom
blktests-ci[bot] wants to merge 12 commits intolinus-master_basefrom
Conversation
Author
|
Upstream branch: d8a9a4b |
910d344 to
ed862bc
Compare
Author
|
Upstream branch: 7ca6d1c |
0e83bf5 to
1a5a045
Compare
ed862bc to
2d0c3d5
Compare
Author
|
Upstream branch: 3aae938 |
1a5a045 to
2d202e3
Compare
2d0c3d5 to
931d9b0
Compare
Author
|
Upstream branch: 3036cd0 |
2d202e3 to
942fce6
Compare
931d9b0 to
78a4682
Compare
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>
Author
|
Upstream branch: 9a9c8ce |
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>
942fce6 to
d7cd01f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: Enable lock context analysis
version: 3
url: https://patchwork.kernel.org/project/linux-block/list/?series=1076625