public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>,
	linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>,
	Laurence Oberman <loberman@redhat.com>,
	Paolo Valente <paolo.valente@linaro.org>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Tom Nguyen <tom81094@gmail.com>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	Omar Sandoval <osandov@fb.com>,
	John Garry <john.garry@huawei.com>
Subject: Re: [PATCH V8 4/7] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops
Date: Fri, 13 Oct 2017 11:32:41 -0600	[thread overview]
Message-ID: <cbeb8016-4f0d-3054-a161-aa48bb63b5a5@kernel.dk> (raw)
In-Reply-To: <20171013172459.1376-5-ming.lei@redhat.com>

On 10/13/2017 11:24 AM, Ming Lei wrote:
> For SCSI devices, there is often per-request-queue depth, which need
> to be respected before queuing one request.
> 
> The current blk-mq always dequeues request first, then calls .queue_rq()
> to dispatch the request to lld. One obvious issue of this way is that I/O
> merge may not be good, because when the per-request-queue depth can't be
> respected, .queue_rq() has to return BLK_STS_RESOURCE, then this request
> has to stay in hctx->dispatch list, and never got chance to participate
> into I/O merge.
> 
> This patch introduces .get_budget and .put_budget callback in blk_mq_ops,
> then we can try to get reserved budget first before dequeuing request.
> Once the budget for queueing I/O can't be satisfied, we don't need to
> dequeue request at all, then I/O merge can get improved a lot.

Still think this should be blk_mq_get_dispatch_budget(), like in the
incremental I sent out. That way you actually know what it is doing,
get_budget() could be anything.

> @@ -2582,6 +2606,9 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
>  	if (!set->ops->queue_rq)
>  		return -EINVAL;
>  
> +	if ((!!set->ops->get_budget) != (!!set->ops->put_budget))
> +		return -EINVAL;

	if (!set->ops->get_budget ^ !set->ops->put_budget)

is cleaner, imho.

-- 
Jens Axboe

  reply	other threads:[~2017-10-13 17:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 17:24 [PATCH V8 0/7] blk-mq-sched: improve sequential I/O performance Ming Lei
2017-10-13 17:24 ` [PATCH V8 1/7] blk-mq-sched: fix scheduler bad performance Ming Lei
2017-10-13 17:30   ` Jens Axboe
2017-10-13 17:24 ` [PATCH V8 2/7] blk-mq-sched: move actual dispatching into one helper Ming Lei
2017-10-13 17:24 ` [PATCH V8 3/7] sbitmap: introduce __sbitmap_for_each_set() Ming Lei
2017-10-13 17:24 ` [PATCH V8 4/7] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops Ming Lei
2017-10-13 17:32   ` Jens Axboe [this message]
2017-10-13 17:24 ` [PATCH V8 5/7] blk-mq-sched: improve dispatching from sw queue Ming Lei
2017-10-13 17:24 ` [PATCH V8 6/7] SCSI: allow to pass null rq to scsi_prep_state_check() Ming Lei
2017-10-13 17:24 ` [PATCH V8 7/7] SCSI: implement .get_budget and .put_budget for blk-mq Ming Lei

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=cbeb8016-4f0d-3054-a161-aa48bb63b5a5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bart.vanassche@sandisk.com \
    --cc=hch@infradead.org \
    --cc=john.garry@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=ming.lei@redhat.com \
    --cc=oleksandr@natalenko.name \
    --cc=osandov@fb.com \
    --cc=paolo.valente@linaro.org \
    --cc=tom81094@gmail.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