summaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-06-10 04:30:43 +0200
committerJens Axboe <axboe@kernel.dk>2023-06-12 17:55:53 +0200
commit4f1731df60f9033669f024d06ae26a6301260b55 (patch)
tree8b3d6dbff9e497e9b2ecf9603284499be48a2bde /kernel/user.c
parentfs: remove the now unused FMODE_* flags (diff)
downloadlinux-4f1731df60f9033669f024d06ae26a6301260b55.tar.xz
linux-4f1731df60f9033669f024d06ae26a6301260b55.zip
blk-mq: fix potential io hang by wrong 'wake_batch'
In __blk_mq_tag_busy/idle(), updating 'active_queues' and calculating 'wake_batch' is not atomic: t1: t2: _blk_mq_tag_busy blk_mq_tag_busy inc active_queues // assume 1->2 inc active_queues // 2 -> 3 blk_mq_update_wake_batch // calculate based on 3 blk_mq_update_wake_batch /* calculate based on 2, while active_queues is actually 3. */ Fix this problem by protecting them wih 'tags->lock', this is not a hot path, so performance should not be concerned. And now that all writers are inside the lock, switch 'actives_queues' from atomic to unsigned int. Fixes: 180dccb0dba4 ("blk-mq: fix tag_get wait task can't be awakened") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230610023043.2559121-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/user.c')
0 files changed, 0 insertions, 0 deletions