[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251014022149.947800-1-yukuai3@huawei.com>
Date: Tue, 14 Oct 2025 10:21:45 +0800
From: Yu Kuai <yukuai3@...wei.com>
To: <nilay@...ux.ibm.com>, <ming.lei@...hat.com>, <tj@...nel.org>,
<josef@...icpanda.com>, <axboe@...nel.dk>
CC: <cgroups@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <yukuai3@...wei.com>,
<yukuai1@...weicloud.com>, <yi.zhang@...wei.com>, <yangerkun@...wei.com>,
<johnny.chenyi@...wei.com>
Subject: [PATCH 0/4] blk-rq-qos: fix possible deadlock
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@kernel.org/
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.
BTW, it's probably better to fix this problem before the above huge
refactor, I'm sending this set anyway to make sure if people will aggree
about the solution.
Yu Kuai (4):
blk-mq-debugfs: warn about possible deadlock
blk-mq-debugfs: factor out a helper blk_mq_debugfs_register_rq_qos()
blk-rq-qos: fix possible deadlock
blk-mq-debugfs: make blk_mq_debugfs_register_rqos() static
block/blk-cgroup.c | 6 +++++
block/blk-mq-debugfs.c | 58 ++++++++++++++++++++++++++++++------------
block/blk-mq-debugfs.h | 4 +--
block/blk-rq-qos.c | 7 -----
block/blk-sysfs.c | 4 +++
block/blk-wbt.c | 7 ++++-
6 files changed, 60 insertions(+), 26 deletions(-)
--
2.39.2
Powered by blists - more mailing lists