From: Omar Sandoval <osandov@osandov.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@fb.com>,
linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH 2/4] blk-mq: introduce blk_mq_get_queue_depth()
Date: Wed, 3 May 2017 09:55:30 -0700 [thread overview]
Message-ID: <20170503165530.GB10775@vader> (raw)
In-Reply-To: <20170428151539.25514-3-ming.lei@redhat.com>
On Fri, Apr 28, 2017 at 11:15:37PM +0800, Ming Lei wrote:
> The hardware queue depth can be resized via blk_mq_update_nr_requests(),
> so introduce this helper for retrieving queue's depth easily.
One nit below. If the per-hardware queue tag space situation changes, we
can revisit this and the similar thing in Kyber.
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> block/blk-mq.c | 12 ++++++++++++
> block/blk-mq.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index e530bc54f0d9..04761fb76ab4 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2637,6 +2637,18 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set)
> }
> EXPORT_SYMBOL(blk_mq_free_tag_set);
>
> +/*
> + * Queue depth can be changed via blk_mq_update_nr_requests(),
> + * so use this helper to retrieve queue's depth.
> + */
> +int blk_mq_get_queue_depth(struct request_queue *q)
> +{
> + /* All queues have same queue depth */
> + struct blk_mq_tags *tags = q->tag_set->tags[0];
Not sure what's going on with the spacing here. Tab instead of a space?
> + return tags->bitmap_tags.sb.depth;
> +}
> +
> int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
> {
> struct blk_mq_tag_set *set = q->tag_set;
> diff --git a/block/blk-mq.h b/block/blk-mq.h
> index 2814a14e529c..8085d5989cf5 100644
> --- a/block/blk-mq.h
> +++ b/block/blk-mq.h
> @@ -166,6 +166,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
> void blk_mq_finish_request(struct request *rq);
> struct request *__blk_mq_alloc_request(struct blk_mq_alloc_data *data,
> unsigned int op);
> +int blk_mq_get_queue_depth(struct request_queue *q);
>
> static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx)
> {
> --
> 2.9.3
>
next prev parent reply other threads:[~2017-05-03 16:55 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 15:15 [PATCH 0/4] blk-mq: support to use hw tag for scheduling Ming Lei
2017-04-28 15:15 ` [PATCH 1/4] blk-mq: introduce BLK_MQ_F_SCHED_USE_HW_TAG Ming Lei
2017-05-03 16:21 ` Omar Sandoval
2017-05-03 16:46 ` Omar Sandoval
2017-05-03 20:13 ` Ming Lei
2017-05-03 21:40 ` Omar Sandoval
2017-05-04 2:01 ` Ming Lei
2017-05-04 2:13 ` Jens Axboe
2017-05-04 2:51 ` Ming Lei
2017-05-04 14:06 ` Jens Axboe
2017-05-05 22:54 ` Ming Lei
2017-05-05 23:33 ` Ming Lei
2017-05-10 7:25 ` Ming Lei
2017-04-28 15:15 ` [PATCH 2/4] blk-mq: introduce blk_mq_get_queue_depth() Ming Lei
2017-04-28 18:23 ` Jens Axboe
2017-04-29 9:55 ` Ming Lei
2017-05-03 16:55 ` Omar Sandoval [this message]
2017-05-04 2:10 ` Ming Lei
2017-04-28 15:15 ` [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough Ming Lei
2017-04-28 18:09 ` Bart Van Assche
2017-04-29 10:35 ` Ming Lei
2017-05-01 15:06 ` Bart Van Assche
2017-05-02 3:49 ` Omar Sandoval
2017-05-02 8:46 ` Ming Lei
2017-04-28 18:22 ` Jens Axboe
2017-04-28 20:11 ` Bart Van Assche
2017-04-29 10:59 ` Ming Lei
2017-05-03 16:29 ` Omar Sandoval
2017-05-03 16:55 ` Ming Lei
2017-05-03 17:00 ` Omar Sandoval
2017-05-03 17:33 ` Ming Lei
2017-04-28 15:15 ` [PATCH 4/4] blk-mq: dump new introduced flag of BLK_MQ_F_SCHED_USE_HW_TAG Ming Lei
2017-04-28 18:10 ` Bart Van Assche
2017-04-29 11:00 ` Ming Lei
2017-04-28 20:29 ` [PATCH 0/4] blk-mq: support to use hw tag for scheduling Jens Axboe
2017-05-03 4:03 ` Ming Lei
2017-05-03 14:08 ` Jens Axboe
2017-05-03 14:10 ` Jens Axboe
2017-05-03 15:03 ` Ming Lei
2017-05-03 15:08 ` Jens Axboe
2017-05-03 15:38 ` Ming Lei
2017-05-03 16:06 ` Omar Sandoval
2017-05-03 16:21 ` Ming Lei
2017-05-03 16:52 ` Ming Lei
2017-05-03 17:03 ` Ming Lei
2017-05-03 17:07 ` Jens Axboe
2017-05-03 17:15 ` Bart Van Assche
2017-05-03 17:24 ` Jens Axboe
2017-05-03 17:35 ` Bart Van Assche
2017-05-03 17:40 ` Jens Axboe
2017-05-03 17:43 ` Bart Van Assche
2017-05-03 17:08 ` Bart Van Assche
2017-05-03 17:11 ` Jens Axboe
2017-05-03 17:19 ` Ming Lei
2017-05-03 17:41 ` 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=20170503165530.GB10775@vader \
--to=osandov@osandov.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.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