]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: wait on correct sbitmap_queue in blk_mq_mark_tag_wait
authorKemeng Shi <shikemeng@huaweicloud.com>
Wed, 18 Jan 2023 09:37:15 +0000 (17:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:34 +0000 (16:43 +0100)
commit061fb012bcf4c51c756578704fe6e3ff6e5e8202
tree14bf0b519a9837d278fc32c51728b308dc872e03
parentdfd1b8268529d5334d2ce9ee89c23bb5a3741f4d
blk-mq: wait on correct sbitmap_queue in blk_mq_mark_tag_wait

[ Upstream commit 98b99e9412d0cde8c7b442bf5efb09528a2ede8b ]

For shared queues case, we will only wait on bitmap_tags if we fail to get
driver tag. However, rq could be from breserved_tags, then two problems
will occur:
1. io hung if no tag is currently allocated from bitmap_tags.
2. unnecessary wakeup when tag is freed to bitmap_tags while no tag is
freed to breserved_tags.
Wait on the bitmap which rq from to fix this.

Fixes: 01f6c5d74aad ("blk-mq: improve tag waiting setup for non-shared tags")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-mq.c