Re: [PATCH -next] blk-wbt: call rq_qos_add() after wb_normal is initialized

From: Jens Axboe
Date: Wed Sep 21 2022 - 10:37:17 EST


On Tue, 13 Sep 2022 18:57:49 +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
>
> Our test found a problem that wbt inflight counter is negative, which
> will cause io hang(noted that this problem doesn't exist in mainline):
>
> t1: device create t2: issue io
> add_disk
> blk_register_queue
> wbt_enable_default
> wbt_init
> rq_qos_add
> // wb_normal is still 0
> /*
> * in mainline, disk can't be opened before
> * bdev_add(), however, in old kernels, disk
> * can be opened before blk_register_queue().
> */
> blkdev_issue_flush
> // disk size is 0, however, it's not checked
> submit_bio_wait
> submit_bio
> blk_mq_submit_bio
> rq_qos_throttle
> wbt_wait
> bio_to_wbt_flags
> rwb_enabled
> // wb_normal is 0, inflight is not increased
>
> [...]

Applied, thanks!

[1/1] blk-wbt: call rq_qos_add() after wb_normal is initialized
commit: 8c5035dfbb9475b67c82b3fdb7351236525bf52b

Best regards,
--
Jens Axboe