]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: update hctx->nr_active in blk_mq_end_request_batch()
authorMing Lei <ming.lei@redhat.com>
Tue, 2 Nov 2021 15:36:19 +0000 (23:36 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Nov 2021 15:27:57 +0000 (09:27 -0600)
commit0c7d1d98c8e5271a9e0c0d9dcbaa3091f18c6a3f
treeb00741334fd7d7a7e1fed3350bd6a2172db76ab2
parentcd9bcaf772683386ed291b073e56ebc354e629da
blk-mq: update hctx->nr_active in blk_mq_end_request_batch()

In case of shared tags and none io sched, batched completion still may
be run into, and hctx->nr_active is accounted when getting driver tag,
so it has to be updated in blk_mq_end_request_batch().

Otherwise, hctx->nr_active may become same with queue depth, then
hctx_may_queue() always return false, then io hang is caused.

Fixes the issue by updating the counter in batched way.

Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 6e6dc2abb7df ("block: add support for blk_mq_end_request_batch()")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20211102153619.3627505-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c
block/blk-mq.h