]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: Fix wrong wakeup batch configuration which will cause hang
authorLaibin Qiu <qiulaibin@huawei.com>
Thu, 27 Jan 2022 10:00:47 +0000 (18:00 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Jan 2022 17:15:32 +0000 (10:15 -0700)
commit3e8b311cf9d49a28cfd45226649d8c6416278f00
tree815182f8e069faa0ade6c37dd86beca376d825c6
parenta03960b5321cd65b27dd59d8d1b409468e9a4350
blk-mq: Fix wrong wakeup batch configuration which will cause hang

Commit 0b3a3c0a74497 ("blk-mq: fix tag_get wait task can't be
awakened") will recalculate wake_batch when incrementing or decrementing
active_queues to avoid wake_batch > hctx_max_depth. At the same time, in
order to not affect performance as much as possible, the minimum wakeup
batch is set to 4. But when the QD is small (such as QD=1), if inc or dec
active_queues increases wakeup batch, that can lead to a hang:

Fix this problem with the following strategies:
QD          :  >= 32 | < 32
---------------------------------
wakeup batch:  8~4   | 3~1

Fixes: 0b3a3c0a74497 ("blk-mq: fix tag_get wait task can't be awakened")
Link: https://lore.kernel.org/linux-block/78cafe94-a787-e006-8851-69906f0c2128@huawei.com/T/#t
Reported-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Signed-off-by: Laibin Qiu <qiulaibin@huawei.com>
Tested-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Link: https://lore.kernel.org/r/20220127100047.1763746-1-qiulaibin@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c