diff options
author | Ming Lei <ming.lei@redhat.com> | 2021-12-03 14:15:31 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-12-03 22:51:29 +0100 |
commit | 2a904d00855f94cb85751e45fa494f225d44ae0d (patch) | |
tree | 0bcc141b19e61b4d536115e274c68da183ae9ff2 /block/genhd.c | |
parent | block: switch to atomic_t for request references (diff) | |
download | linux-2a904d00855f94cb85751e45fa494f225d44ae0d.tar.xz linux-2a904d00855f94cb85751e45fa494f225d44ae0d.zip |
blk-mq: remove hctx_lock and hctx_unlock
Remove hctx_lock and hctx_unlock, and add one helper of
blk_mq_run_dispatch_ops() to run code block defined in dispatch_ops
with rcu/srcu read held.
Compared with hctx_lock()/hctx_unlock():
1) remove 2 branch to 1, so we just need to check
(hctx->flags & BLK_MQ_F_BLOCKING) once when running one dispatch_ops
2) srcu_idx needn't to be touched in case of non-blocking
3) might_sleep_if() can be moved to the blocking branch
Also put the added blk_mq_run_dispatch_ops() in private header, so that
the following patch can use it out of blk-mq.c.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20211203131534.3668411-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
0 files changed, 0 insertions, 0 deletions