From: Christoph Hellwig <hch@infradead.org>
To: "Wang Jianchao (Kuaishou)" <jianchao.wan9@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>, 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: Re: [RFC V4 4/6] blk-iocost: make iocost pluggable
Date: Thu, 17 Feb 2022 00:52:43 -0800 [thread overview]
Message-ID: <Yg4M2+eG1EGY/+vV@infradead.org> (raw)
In-Reply-To: <20220217031349.98561-5-jianchao.wan9@gmail.com>
On Thu, Feb 17, 2022 at 11:13:47AM +0800, Wang Jianchao (Kuaishou) wrote:
> Make blk-iocost pluggable. Then we can close or open it through
> /sys/block/xxx/queue/qos.
>
> Signed-off-by: Wang Jianchao (Kuaishou) <jianchao.wan9@gmail.com>
> ---
> block/blk-iocost.c | 52 ++++++++++++++++++++++++++----------------
> block/blk-mq-debugfs.c | 2 --
> block/blk-rq-qos.h | 1 -
> 3 files changed, 32 insertions(+), 23 deletions(-)
>
> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
> index 769b64394298..5a3a45985b49 100644
> --- a/block/blk-iocost.c
> +++ b/block/blk-iocost.c
> @@ -660,9 +660,10 @@ static struct ioc *rqos_to_ioc(struct rq_qos *rqos)
> return container_of(rqos, struct ioc, rqos);
> }
>
> +static struct rq_qos_ops ioc_rqos_ops;
> static struct ioc *q_to_ioc(struct request_queue *q)
> {
> - return rqos_to_ioc(rq_qos_id(q, RQ_QOS_COST));
> + return rqos_to_ioc(rq_qos_by_id(q, ioc_rqos_ops.id));
> }
This has a single caller, so just open code it.
> +static int blk_iocost_init(struct request_queue *q);
> +
> static struct rq_qos_ops ioc_rqos_ops = {
> + .name = "blk-iocost",
> + .flags = RQOS_FLAG_CGRP_POL,
> .throttle = ioc_rqos_throttle,
> .merge = ioc_rqos_merge,
> .done_bio = ioc_rqos_done_bio,
> .done = ioc_rqos_done,
> .queue_depth_changed = ioc_rqos_queue_depth_changed,
> .exit = ioc_rqos_exit,
> + .init = blk_iocost_init,
> };
Again, move rq_qos_ops below the init function to avoid the forward
declaration.
next prev parent reply other threads:[~2022-02-17 8:52 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 3:13 [RFC V4 0/6] blk: make blk-rq-qos policies pluggable and modular Wang Jianchao (Kuaishou)
2022-02-17 3:13 ` [RFC V4 1/6] blk: prepare to make blk-rq-qos " Wang Jianchao (Kuaishou)
2022-02-17 8:48 ` Christoph Hellwig
2022-02-18 3:34 ` Wang Jianchao
2022-02-22 17:19 ` Tejun Heo
2022-02-23 3:08 ` Wang Jianchao
2022-02-23 3:10 ` Wang Jianchao
2022-02-23 21:37 ` Tejun Heo
2022-02-24 1:51 ` Wang Jianchao
2022-02-24 2:07 ` Tejun Heo
2022-02-24 2:50 ` Wang Jianchao
2022-02-24 16:53 ` Tejun Heo
2022-02-25 2:02 ` Wang Jianchao
2022-02-17 3:13 ` [RFC V4 2/6] blk-wbt: make wbt pluggable Wang Jianchao (Kuaishou)
2022-02-17 8:50 ` Christoph Hellwig
2022-02-18 3:41 ` Wang Jianchao
2022-02-22 8:12 ` Christoph Hellwig
2022-02-17 3:13 ` [RFC V4 3/6] blk-iolatency: make iolatency pluggable Wang Jianchao (Kuaishou)
2022-02-17 8:51 ` Christoph Hellwig
2022-02-18 3:42 ` Wang Jianchao
2022-02-17 3:13 ` [RFC V4 4/6] blk-iocost: make iocost pluggable Wang Jianchao (Kuaishou)
2022-02-17 8:52 ` Christoph Hellwig [this message]
2022-02-18 3:43 ` Wang Jianchao
2022-02-17 3:13 ` [RFC V4 5/6] blk-ioprio: make ioprio pluggable and modular Wang Jianchao (Kuaishou)
2022-02-17 8:54 ` Christoph Hellwig
2022-02-17 3:13 ` [RFC V4 6/6] blk: export the sysfs for switching qos Wang Jianchao (Kuaishou)
2022-02-17 8:55 ` Christoph Hellwig
2022-02-18 3:43 ` Wang Jianchao
2022-02-17 3:21 ` [RFC V4 0/6] blk: make blk-rq-qos policies pluggable and modular Jens Axboe
2022-02-17 3:53 ` Wang Jianchao
2022-02-17 8:43 ` Christoph Hellwig
2022-02-18 3:22 ` Wang Jianchao
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=Yg4M2+eG1EGY/+vV@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=jbacik@fb.com \
--cc=jianchao.wan9@gmail.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®