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 12:54:01 -0800 [thread overview]
Message-ID: <20170126205401.GE21449@vader.DHCP.thefacebook.com> (raw)
In-Reply-To: <1485460098-16608-6-git-send-email-axboe@fb.com>
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().
> Signed-off-by: Jens Axboe <axboe@fb.com>
> ---
> block/blk-mq-sched.c | 23 +++++++++++++++--------
> block/blk-mq.c | 2 +-
> block/mq-deadline.c | 10 ++++++----
> include/linux/elevator.h | 2 +-
> 4 files changed, 23 insertions(+), 14 deletions(-)
next prev parent reply other threads:[~2017-01-26 20:55 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 [this message]
2017-01-26 20:59 ` Jens Axboe
2017-01-26 21:11 ` Omar Sandoval
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=20170126205401.GE21449@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox