]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: don't grab ->q_usage_counter in blk_mq_sched_bio_merge
authorMing Lei <ming.lei@redhat.com>
Thu, 11 Nov 2021 08:51:33 +0000 (16:51 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 11 Nov 2021 18:52:33 +0000 (11:52 -0700)
commitaba493eb9d5314e660e26933f27768f479dfc793
tree0f53e8e80279c25b7992bae4d94d93004fa15980
parentb9baf2a23bb1bbd61a74b48b8e7fc3774a8e47f1
blk-mq: don't grab ->q_usage_counter in blk_mq_sched_bio_merge

blk_mq_sched_bio_merge is only called from blk-mq.c:blk_attempt_bio_merge(),
which is called when queue usage counter is grabbed already:

1) blk_mq_get_new_requests()

2) blk_mq_get_request()
- cached request in current plug owns one queue usage counter

So don't grab ->q_usage_counter in blk_mq_sched_bio_merge(), and more
importantly this nest way causes hang in blk_mq_freeze_queue_wait().

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211111085134.345235-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c