Re: [PATCH -next v2] blk-mq: fix potential io hang by wrong 'wake_batch'

From: Jens Axboe
Date: Mon Jun 12 2023 - 11:57:19 EST



On Sat, 10 Jun 2023 10:30:43 +0800, Yu Kuai wrote:
> 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. */
>
> [...]

Applied, thanks!

[1/1] blk-mq: fix potential io hang by wrong 'wake_batch'
commit: 4f1731df60f9033669f024d06ae26a6301260b55

Best regards,
--
Jens Axboe