All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Jens Axboe <axboe@fb.com>
Cc: linux-block@vger.kernel.org, bart.vanassche@sandisk.com,
	hch@lst.de, osandov@fb.com, paolo.valente@linaro.org,
	hare@suse.com
Subject: Re: [PATCH 5/5] blk-mq-sched: change ->dispatch_requests() to ->dispatch_request()
Date: Thu, 26 Jan 2017 13:11:11 -0800	[thread overview]
Message-ID: <20170126211111.GA27224@vader.DHCP.thefacebook.com> (raw)
In-Reply-To: <23e5ff92-f909-7d80-ac65-34913cd9310c@fb.com>

On Thu, Jan 26, 2017 at 01:59:23PM -0700, Jens Axboe wrote:
> On 01/26/2017 01:54 PM, Omar Sandoval wrote:
> > On Thu, Jan 26, 2017 at 12:48:18PM -0700, Jens Axboe wrote:
> >> When we invoke dispatch_requests(), the scheduler empties everything
> >> into the passed in list. This isn't always a good thing, since it
> >> means that we remove items that we could have potentially merged
> >> with.
> >>
> >> Change the function to dispatch single requests at the time. If
> >> we do that, we can backoff exactly at the point where the device
> >> can't consume more IO, and leave the rest with the scheduler for
> >> better merging and future dispatch decision making.
> > 
> > Hmm, I think I previously changed this from ->dispatch_request() to
> > ->dispatch_requests() to support schedulers using software queues. My
> > current mq-token stuff doesn't have a ->dispatch_requests() hook anymore
> > after the sched_tags rework, but I think I'm going to need it again
> > soon. Having the scheduler do blk_mq_flush_busy_ctxs() into its own
> > private list and then handing the requests out one-by-one kinda sucks.
> > (Plus, deferred issue wouldn't work with this, but it's not implemented,
> > anyways :)
> > 
> > One idea: what if we have the scheduler get the driver tags inside of
> > its ->dispatch_requests()? For example, __dd_dispatch_request() could
> > first check whether it has a request to dispatch and then try to grab a
> > driver tag. If it succeeds, it dispatches the request, and if it
> > doesn't, it marks itself as needing restart.
> > 
> > With that, the scheduler will only return requests ready for
> > ->queue_rq(), meaning we could get rid of the list reshuffling in
> > blk_mq_dispatch_rq_list().
> 
> That'd work for the driver tags, but it would not work for the case
> where the driver returns BUSY. So we'd only be covering some of the
> cases. That may or may not matter... Hard to say.

Right, I didn't think of that case.

> I appreciate having
> the hook that dispatches them all for efficiency reasons, but from a
> scheduler point of view, sending off one is generally simpler and it'll
> be better for rotational storage since we depend so heavily on merging
> to get good performance there.
> 
> I'm definitely open to alternatives. We can keep the dispatch_requests()
> and pass in a dispatch count, ramping up the dispatch count or something
> like that. Seems a bit fragile though, and hard to get right.

Yeah, beyond having a way to shove requests back into the scheduler, I
can't think of a good way to reconcile it. I guess we can go with this,
and I'll figure something out for the software queue case.

Begrudgingly-reviewed-by: Omar Sandoval <osandov@fb.com>

  reply	other threads:[~2017-01-26 21:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 19:48 [PATCH 0/5] blk-mq: various blk-mq/blk-mq-sched fixes Jens Axboe
2017-01-26 19:48 ` [PATCH 1/5] blk-mq: improve scheduler queue sync/async running Jens Axboe
2017-01-26 19:59   ` Omar Sandoval
2017-01-26 19:48 ` [PATCH 2/5] blk-mq: fix potential race in queue restart and driver tag allocation Jens Axboe
2017-01-26 19:52   ` Jens Axboe
2017-01-26 20:04     ` Omar Sandoval
2017-01-26 19:48 ` [PATCH 3/5] blk-mq: release driver tag on a requeue event Jens Axboe
2017-01-26 20:06   ` Omar Sandoval
2017-01-26 19:48 ` [PATCH 4/5] blk-mq-sched: fix starvation for multiple hardware queues and shared tags Jens Axboe
2017-01-26 20:25   ` Omar Sandoval
2017-01-26 20:26     ` Jens Axboe
2017-01-26 19:48 ` [PATCH 5/5] blk-mq-sched: change ->dispatch_requests() to ->dispatch_request() Jens Axboe
2017-01-26 20:54   ` Omar Sandoval
2017-01-26 20:59     ` Jens Axboe
2017-01-26 21:11       ` Omar Sandoval [this message]
2017-01-26 21:15         ` Jens Axboe
2017-01-27 12:10 ` [PATCH 0/5] blk-mq: various blk-mq/blk-mq-sched fixes Hannes Reinecke
2017-01-27 14:40   ` Jens Axboe

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=20170126211111.GA27224@vader.DHCP.thefacebook.com \
    --to=osandov@osandov.com \
    --cc=axboe@fb.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    --cc=paolo.valente@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.