Thread (7 messages) flat view 7 messages, 2 authors, 2021-09-23
STALE1828d

[PATCH 4/4] block: cancel all throttled bios in blk_cleanup_queue()

From: Yu Kuai <hidden>
Date: 2021-09-22 12:41:54
Also in: cgroups, lkml
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help