Files
lkl_linux/include/linux
Yu Kuai 4f1731df60 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: 180dccb0db ("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>
2023-06-12 09:55:53 -06:00
..
2023-03-29 12:26:32 +02:00
2023-03-06 12:33:02 +02:00
2023-04-21 14:37:03 +01:00
2023-06-05 10:53:04 -06:00
2023-04-16 08:51:24 -07:00
2023-02-03 08:20:55 -07:00
2023-03-05 10:49:37 -08:00
2023-03-23 16:02:27 -10:00
2023-04-17 18:01:23 +02:00
2023-04-20 18:20:04 +08:00
2023-03-06 15:49:07 -06:00
2023-01-29 15:18:33 -07:00
2023-01-29 15:18:33 -07:00
2023-02-06 19:06:58 +01:00
2023-03-29 16:00:23 +02:00
2023-03-19 10:02:04 -07:00
2023-06-12 08:04:05 -06:00
2023-03-06 12:33:02 +02:00
2023-02-13 10:11:20 +02:00
2023-03-07 22:04:45 +05:30
2023-03-29 12:26:32 +02:00
2023-03-15 14:58:52 +01:00
2023-04-03 11:16:56 +02:00
2023-03-06 09:57:07 +01:00
2023-03-17 15:00:40 +01:00
2023-03-16 13:08:39 -07:00
2023-05-24 08:42:17 -06:00
2023-03-23 17:25:46 +01:00
2023-03-29 08:19:38 +01:00
2023-04-05 20:03:01 -07:00
2023-04-21 03:02:34 -04:00
2023-03-06 09:57:11 +01:00