linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Jianchao <jianchao.wan9@gmail.com>
To: axboe@kernel.dk
Cc: jbacik@fb.com, tj@kernel.org, bvanassche@acm.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 11/13] blk: remove unused interfaces of blk-rq-qos
Date: Mon, 10 Jan 2022 17:10:44 +0800	[thread overview]
Message-ID: <20220110091046.17010-12-jianchao.wan9@gmail.com> (raw)
In-Reply-To: <20220110091046.17010-1-jianchao.wan9@gmail.com>

From: Wang Jianchao <wangjianchao@kuaishou.com>

No functional changes here

Signed-off-by: Wang Jianchao <wangjianchao@kuaishou.com>
---
 block/blk-mq-debugfs.c | 10 +-------
 block/blk-rq-qos.h     | 52 +-----------------------------------------
 2 files changed, 2 insertions(+), 60 deletions(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 90610a0cd25a..f4f5ca1953f3 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -817,11 +817,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);
@@ -832,9 +827,6 @@ EXPORT_SYMBOL_GPL(blk_mq_debugfs_unregister_rqos);
 void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
 {
 	struct request_queue *q = rqos->q;
-	const char *dir_name;
-
-	dir_name = rqos->ops->name ? rqos->ops->name : rq_qos_id_to_name(rqos->id);
 
 	if (rqos->debugfs_dir || !rqos->ops->debugfs_attrs)
 		return;
@@ -843,7 +835,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 ee396367a5b2..123b6b100355 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;
@@ -28,7 +24,7 @@ struct rq_qos {
 	bool dying;
 	const struct rq_qos_ops *ops;
 	struct request_queue *q;
-	enum rq_qos_id id;
+	int id;
 	struct rq_qos *next;
 #ifdef CONFIG_BLK_DEBUG_FS
 	struct dentry *debugfs_dir;
@@ -89,52 +85,6 @@ static inline void rq_wait_init(struct rq_wait *rq_wait)
 	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


  parent reply	other threads:[~2022-01-10  9:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  9:10 [PATCH 0/13] blk: make blk-rq-qos policies pluggable and modular Wang Jianchao
2022-01-10  9:10 ` [PATCH 01/13] blk: make blk-rq-qos support pluggable and modular policy Wang Jianchao
2022-01-13  1:49   ` kernel test robot
2022-01-13  3:52     ` Wang Jianchao
2022-01-10  9:10 ` [PATCH 02/13] blk-wbt: make wbt pluggable Wang Jianchao
2022-01-10  9:10 ` [PATCH 03/13] blk: export following interfaces Wang Jianchao
2022-01-10  9:10 ` [PATCH 04/13] cgroup: export following two interfaces Wang Jianchao
2022-01-10  9:10 ` [PATCH 05/13] blk-iolatency: make iolatency pluggable and modular Wang Jianchao
2022-01-10  9:10 ` [PATCH 06/13] blk: remove unused BLK_RQ_IO_DATA_LEN Wang Jianchao
2022-01-10  9:10 ` [PATCH 07/13] blk: use standalone macro to control bio.bi_iocost_cost Wang Jianchao
2022-01-10  9:10 ` [PATCH 08/13] blk-iocost: make iocost pluggable and modular Wang Jianchao
2022-01-10  9:10 ` [PATCH 09/13] blk: rename ioprio.c to ioprio-common.c Wang Jianchao
2022-01-10  9:10 ` [PATCH 10/13] blk-ioprio: make ioprio pluggable and modular Wang Jianchao
2022-01-10  9:10 ` Wang Jianchao [this message]
2022-01-10  9:10 ` [PATCH 12/13] blk: make request able to carry blkcg_gq Wang Jianchao
2022-01-10  9:10 ` [PATCH 13/13] blk: introduce iostat per cgroup module Wang Jianchao
2022-01-12 20:13   ` Tejun Heo
2022-01-13  2:40     ` Wang Jianchao
2022-01-13 17:01       ` Tejun Heo
2022-01-14  2:01         ` Wang Jianchao
2022-01-10 17:36 ` [PATCH 0/13] blk: make blk-rq-qos policies pluggable and modular Christoph Hellwig
2022-01-11  1:53   ` Wang Jianchao
2022-01-11  3:25   ` Bart Van Assche

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=20220110091046.17010-12-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;
as well as URLs for NNTP newsgroup(s).