From: "Wang Jianchao (Kuaishou)" <jianchao.wan9@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: hch@infradead.org, Bart Van Assche <bvanassche@acm.org>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] blk: do rq_qos_exit in blk_cleanup_queue
Date: Wed, 16 Feb 2022 19:32:12 +0800 [thread overview]
Message-ID: <20220216113212.83000-1-jianchao.wan9@gmail.com> (raw)
From: Wang Jianchao <wangjianchao@kuaishou.com>
When __alloc_disk_node() failed, there will not not del_gendisk()
any more, then resource in rqos policies is leaked. Add rq_qos_exit()
into blk_cleanup_queue(). rqos is removed from the list, so needn't
to worry .exit is called twice.
Fixes: commit 8e141f9eb803 ("block: drain file system I/O on del_gendisk")
Suggested-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Wang Jianchao <wangjianchao@kuaishou.com>
---
block/blk-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index d93e3bb9a769..108c7207d048 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -50,6 +50,7 @@
#include "blk-mq-sched.h"
#include "blk-pm.h"
#include "blk-throttle.h"
+#include "blk-rq-qos.h"
struct dentry *blk_debugfs_root;
@@ -322,6 +323,8 @@ void blk_cleanup_queue(struct request_queue *q)
blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
+ rq_qos_exit(q);
+
blk_sync_queue(q);
if (queue_is_mq(q)) {
blk_mq_cancel_work_sync(q);
--
2.17.1
next reply other threads:[~2022-02-16 11:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 11:32 Wang Jianchao (Kuaishou) [this message]
2022-02-16 18:25 ` Bart Van Assche
2022-02-17 2:40 ` Jens Axboe
2022-02-17 7:48 ` Christoph Hellwig
2022-02-17 13:34 ` Jens Axboe
2022-02-17 14:03 ` Christoph Hellwig
2022-02-17 14:55 ` Jens Axboe
2022-02-17 15:48 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220216113212.83000-1-jianchao.wan9@gmail.com \
--to=jianchao.wan9@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®