]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: Fix potential io hung for shared sbitmap per tagset
authorKemeng Shi <shikemeng@huaweicloud.com>
Wed, 18 Jan 2023 09:37:16 +0000 (17:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:44 +0000 (09:32 +0100)
commite3d6d60a53faa14951a7de8159c3f6876d2e4468
tree727dc87c1e40b5197f132517381d03c008b81181
parente8f9f2bfc4d4ebe99e0cdad28bd3f28b05d0b6e6
blk-mq: Fix potential io hung for shared sbitmap per tagset

[ Upstream commit 3217545b34c1313f09bf0f037b50bba4ac81a879 ]

Commit 01f6c5d74aadb ("blk-mq: improve tag waiting setup for non-shared
tags") mark restart for unshared tags for improvement. At that time,
tags is only shared betweens queues and we can check if tags is shared
by test BLK_MQ_F_TAG_SHARED.
Afterwards, commit ce6f9fb44f4ef ("blk-mq: Facilitate a shared sbitmap per
tagset") enabled tags share betweens hctxs inside a queue. We only
mark restart for shared hctxs inside a queue and may cause io hung if
there is no tag currently allocated by hctxs going to be marked restart.
Wait on sbitmap_queue instead of mark restart for shared hctxs case to
fix this.

Fixes: ce6f9fb44f4e ("blk-mq: Facilitate a shared sbitmap per tagset")
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-mq.c