From: Yufen Yu <yuyufen@huawei.com>
To: <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <ming.lei@redhat.com>, <hch@lst.de>
Subject: [RESEND PATCH v2 1/7] block: invoke blk_mq_exit_sched no matter whether have .exit_sched
Date: Thu, 8 Oct 2020 23:26:27 -0400 [thread overview]
Message-ID: <20201009032633.83645-2-yuyufen@huawei.com> (raw)
In-Reply-To: <20201009032633.83645-1-yuyufen@huawei.com>
We will register debugfs for scheduler no matter whether it have
defined callback funciton .exit_sched. So, blk_mq_exit_sched()
is always needed to unregister debugfs. Also, q->elevator should
be set as NULL after exiting scheduler.
For now, since all register scheduler have defined .exit_sched,
it will not cause any actual problem. But It will be more reasonable
to do this change.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
block/blk-sysfs.c | 1 -
block/elevator.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 7dda709f3ccb..ee2cd4d1054c 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -883,7 +883,6 @@ static void blk_exit_queue(struct request_queue *q)
if (q->elevator) {
ioc_clear_queue(q);
__elevator_exit(q, q->elevator);
- q->elevator = NULL;
}
/*
diff --git a/block/elevator.c b/block/elevator.c
index 90ed7a28c21d..7d76b61e157a 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -191,8 +191,7 @@ static void elevator_release(struct kobject *kobj)
void __elevator_exit(struct request_queue *q, struct elevator_queue *e)
{
mutex_lock(&e->sysfs_lock);
- if (e->type->ops.exit_sched)
- blk_mq_exit_sched(q, e);
+ blk_mq_exit_sched(q, e);
mutex_unlock(&e->sysfs_lock);
kobject_put(&e->kobj);
--
2.25.4
next prev parent reply other threads:[~2020-10-09 3:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 3:26 [RESEND PATCH v2 0/7] some improvements and cleanups for block Yufen Yu
2020-10-09 3:26 ` Yufen Yu [this message]
2020-10-09 3:26 ` [RESEND PATCH v2 2/7] block: remove redundant mq check Yufen Yu
2020-10-09 3:26 ` [RESEND PATCH v2 3/7] block: use helper function to test queue register Yufen Yu
2020-10-09 3:26 ` [RESEND PATCH v2 4/7] blk-mq: use helper function to test hw stopped Yufen Yu
2020-10-09 3:26 ` [RESEND PATCH v2 5/7] block: fix comment and add lockdep assert Yufen Yu
2020-10-09 3:26 ` [RESEND PATCH v2 6/7] block: get rid of unnecessary local variable Yufen Yu
2020-10-09 3:26 ` [RESEND PATCH v2 7/7] blk-mq: get rid of the dead flush handle code path Yufen Yu
2020-10-09 18:45 ` [RESEND PATCH v2 0/7] some improvements and cleanups for block Jens Axboe
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=20201009032633.83645-2-yuyufen@huawei.com \
--to=yuyufen@huawei.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).