[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210922125115.381752-5-yukuai3@huawei.com>
Date: Wed, 22 Sep 2021 20:51:15 +0800
From: Yu Kuai <yukuai3@...wei.com>
To: <axboe@...nel.dk>, <tj@...nel.org>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<cgroups@...r.kernel.org>, <yukuai3@...wei.com>,
<yi.zhang@...wei.com>
Subject: [PATCH 4/4] block: cancel all throttled bios in blk_cleanup_queue()
Throttled bios can't be issued after queue is dying in
blk_cleanup_queue(), thus it's better to cancel them immediately
rather than waiting for throttle is done.
For example, if user thread is throttled with low bps while is
issuing large io, and the device is deleted. The user thread will
wait for a long time for io to return.
Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
block/blk-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index 5454db2fa263..356a56318068 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -389,6 +389,9 @@ void blk_cleanup_queue(struct request_queue *q)
blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
+ if (q->root_blkg)
+ blk_throtl_cancel_bios(q);
+
/* for synchronous bio-based driver finish in-flight integrity i/o */
blk_flush_integrity();
--
2.31.1
Powered by blists - more mailing lists