lkml.org 
[lkml]   [2021]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] block: cancel all throttled bios in del_gendisk()
Date
Throttled bios can't be issued after del_gendisk() is done, 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 it's
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@huawei.com>
---
block/genhd.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/block/genhd.c b/block/genhd.c
index 8e9cbf23c510..24fa3356d164 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -28,6 +28,7 @@

#include "blk.h"
#include "blk-rq-qos.h"
+#include "blk-throttle.h"

static struct kobject *block_depr;

@@ -619,6 +620,7 @@ void del_gendisk(struct gendisk *disk)

blk_mq_freeze_queue_wait(q);

+ blk_throtl_cancel_bios(q);
rq_qos_exit(q);
blk_sync_queue(q);
blk_flush_integrity();
--
2.31.1
\
 
 \ /
  Last update: 2021-11-27 11:01    [W:0.077 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site