From: "Wang Jianchao (Kuaishou)" <jianchao.wan9@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Josef Bacik <jbacik@fb.com>, Tejun Heo <tj@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC V5 07/16] blk/rq-qos: get rid of unused interfaces of rqos
Date: Thu, 24 Feb 2022 17:06:45 +0800 [thread overview]
Message-ID: <20220224090654.54671-8-jianchao.wan9@gmail.com> (raw)
In-Reply-To: <20220224090654.54671-1-jianchao.wan9@gmail.com>
No functional changes here
Signed-off-by: Wang Jianchao (Kuaishou) <jianchao.wan9@gmail.com>
---
block/blk-mq-debugfs.c | 13 +--------
block/blk-rq-qos.h | 63 +-----------------------------------------
2 files changed, 2 insertions(+), 74 deletions(-)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index a35f2d6dd422..7e3c3cc1b1a9 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -823,11 +823,6 @@ void blk_mq_debugfs_unregister_sched(struct request_queue *q)
q->sched_debugfs_dir = NULL;
}
-static const char *rq_qos_id_to_name(enum rq_qos_id id)
-{
- return "unknown";
-}
-
void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
{
debugfs_remove_recursive(rqos->debugfs_dir);
@@ -837,12 +832,6 @@ void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
{
struct request_queue *q = rqos->q;
- const char *dir_name;
-
- if (rqos->ops->name)
- dir_name = rqos->ops->name;
- else
- dir_name = rq_qos_id_to_name(rqos->id);
if (rqos->debugfs_dir || !rqos->ops->debugfs_attrs)
return;
@@ -851,7 +840,7 @@ void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
q->rqos_debugfs_dir = debugfs_create_dir("rqos",
q->debugfs_dir);
- rqos->debugfs_dir = debugfs_create_dir(dir_name,
+ rqos->debugfs_dir = debugfs_create_dir(rqos->ops->name,
rqos->q->rqos_debugfs_dir);
debugfs_create_files(rqos->debugfs_dir, rqos, rqos->ops->debugfs_attrs);
diff --git a/block/blk-rq-qos.h b/block/blk-rq-qos.h
index 5a26eb128456..58aba16c7d32 100644
--- a/block/blk-rq-qos.h
+++ b/block/blk-rq-qos.h
@@ -13,10 +13,6 @@
struct blk_mq_debugfs_attr;
-enum rq_qos_id {
- RQ_QOS_UNUSED,
-};
-
struct rq_wait {
wait_queue_head_t wait;
atomic_t inflight;
@@ -25,7 +21,7 @@ struct rq_wait {
struct rq_qos {
const struct rq_qos_ops *ops;
struct request_queue *q;
- enum rq_qos_id id;
+ int id;
refcount_t ref;
wait_queue_head_t waitq;
bool dying;
@@ -62,69 +58,12 @@ struct rq_depth {
unsigned int default_depth;
};
-static inline struct rq_qos *rq_qos_id(struct request_queue *q,
- enum rq_qos_id id)
-{
- struct rq_qos *rqos;
- for (rqos = q->rq_qos; rqos; rqos = rqos->next) {
- if (rqos->id == id)
- break;
- }
- return rqos;
-}
-
static inline void rq_wait_init(struct rq_wait *rq_wait)
{
atomic_set(&rq_wait->inflight, 0);
init_waitqueue_head(&rq_wait->wait);
}
-static inline void rq_qos_add(struct request_queue *q, struct rq_qos *rqos)
-{
- /*
- * No IO can be in-flight when adding rqos, so freeze queue, which
- * is fine since we only support rq_qos for blk-mq queue.
- *
- * Reuse ->queue_lock for protecting against other concurrent
- * rq_qos adding/deleting
- */
- blk_mq_freeze_queue(q);
-
- spin_lock_irq(&q->queue_lock);
- rqos->next = q->rq_qos;
- q->rq_qos = rqos;
- spin_unlock_irq(&q->queue_lock);
-
- blk_mq_unfreeze_queue(q);
-
- if (rqos->ops->debugfs_attrs)
- blk_mq_debugfs_register_rqos(rqos);
-}
-
-static inline void rq_qos_del(struct request_queue *q, struct rq_qos *rqos)
-{
- struct rq_qos **cur;
-
- /*
- * See comment in rq_qos_add() about freezing queue & using
- * ->queue_lock.
- */
- blk_mq_freeze_queue(q);
-
- spin_lock_irq(&q->queue_lock);
- for (cur = &q->rq_qos; *cur; cur = &(*cur)->next) {
- if (*cur == rqos) {
- *cur = rqos->next;
- break;
- }
- }
- spin_unlock_irq(&q->queue_lock);
-
- blk_mq_unfreeze_queue(q);
-
- blk_mq_debugfs_unregister_rqos(rqos);
-}
-
int rq_qos_register(struct rq_qos_ops *ops);
void rq_qos_unregister(struct rq_qos_ops *ops);
void rq_qos_activate(struct request_queue *q,
--
2.17.1
next prev parent reply other threads:[~2022-02-24 9:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 9:06 [RFC V5 0/16] blk: blk-rq-qos framework refactor and cleanup Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 01/16] blk: make the whole blk_mq_submit_bio under q_usage_counter Wang Jianchao (Kuaishou)
2022-02-24 13:38 ` Christoph Hellwig
2022-02-25 2:11 ` Wang Jianchao
2022-02-24 9:06 ` [RFC V5 02/16] blk/rq-qos: prepare to make blk-rq-qos pluggable Wang Jianchao (Kuaishou)
2022-02-24 13:45 ` Christoph Hellwig
2022-02-24 16:55 ` Tejun Heo
2022-02-24 9:06 ` [RFC V5 03/16] blk-wbt: make wbt pluggable Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 04/16] blk-iolatency: make iolatency pluggable Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 05/16] blk-iocost: make iocost pluggable Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 06/16] blk-ioprio: make ioprio pluggable Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` Wang Jianchao (Kuaishou) [this message]
2022-02-24 9:06 ` [RFC V5 08/16] blk/rq-qos: export the sysfs for switching qos Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 09/16] blk-wbt: show wbt_lat_us sysfs interface only when wbt is opened Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 10/16] blk-wbt: get rid of wbt_enable/disable_default() Wang Jianchao (Kuaishou)
2022-02-24 13:46 ` Christoph Hellwig
2022-02-24 16:56 ` Tejun Heo
2022-02-24 9:06 ` [RFC V5 11/16] blk/rq-qos: get rid of debugfs register in blk_mq_debugfs_register Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 12/16] blk/rq-qos: change queue_depth_changed to setting_changed Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 13/16] blk-wbt: move cache setting to rq_qos_setting_changed() Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 14/16] blk-wbt: cleanup the blk-wbt.h Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 15/16] blk/rq-qos: move the rqos debugfs code to blk-rq-qos.c Wang Jianchao (Kuaishou)
2022-02-24 9:06 ` [RFC V5 16/16] blk/rq-qos: add config to control the whole blk-rq-qos framework Wang Jianchao (Kuaishou)
2022-02-24 13:37 ` [RFC V5 0/16] blk: blk-rq-qos framework refactor and cleanup 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=20220224090654.54671-8-jianchao.wan9@gmail.com \
--to=jianchao.wan9@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=jbacik@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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®