Re: [PATCH 0/4] blk-rq-qos: fix possible deadlock
From: Nilay Shroff
Date: Tue Oct 14 2025 - 06:58:47 EST
On 10/14/25 7:51 AM, Yu Kuai wrote:
> Currently rq-qos debugfs entries is created from rq_qos_add(), while
> rq_qos_add() requires queue to be freezed. This can deadlock because
>
> creating new entries can trigger fs reclaim.
>
> Fix this problem by delaying creating rq-qos debugfs entries until
> it's initialization is complete.
>
> - For wbt, it can be initialized by default of by blk-sysfs, fix it by
> delaying after wbt_init();
> - For other policies, they can only be initialized by blkg configuration,
> fix it by delaying to blkg_conf_end();
>
> Noted this set is cooked on the top of my other thread:
> https://lore.kernel.org/all/20251010091446.3048529-1-yukuai@xxxxxxxxxx/
>
> And the deadlock can be reporduced with above thead, by running blktests
> throtl/001 with wbt enabled by default. While the deadlock is really a
> long term problem.
>
While freezing the queue we also mark GFP_NOIO scope, so doesn't that
help avoid fs-reclaim? Or maybe if you can share the lockdep splat
encountered running throtl/001?
Thanks,
--Nilay