From: Arnd Bergmann <arnd@arndb.de>
To: Paolo Valente <paolo.valente@linaro.org>
Cc: Hannes Reinecke <hare@suse.de>,
Linus Walleij <linus.walleij@linaro.org>,
Christoph Hellwig <hch@lst.de>,
Ritesh Harjani <riteshh@codeaurora.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Jens Axboe <axboe@kernel.dk>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
linux-block@vger.kernel.org,
Chunyan Zhang <zhang.chunyan@linaro.org>,
Baolin Wang <baolin.wang@linaro.org>
Subject: Re: [PATCH v2] RFD: switch MMC/SD to use blk-mq multiqueueing
Date: Wed, 04 Jan 2017 00:06:57 +0100 [thread overview]
Message-ID: <3094495.7JvYrDVNM5@wuerfel> (raw)
In-Reply-To: <1C95E699-F2E5-4502-8A00-79CBEBD019EC@linaro.org>
On Tuesday, January 3, 2017 8:50:11 AM CET Paolo Valente wrote:
>
> Sorry for the noise, but, assuming that an ignorant point of view
> might have some value, exactly because it ignores details, here is my
> point of view. IMO the cleanest design would be the one where blk-mq
> does only the job it has been designed for, i.e., pushes requests into
> queues, and the driver takes care of the idiosyncrasies of the
> device. Concretely, the driver could
> 1) advertise a long queue (e.g., 32) to be constantly fed with a
> large window of requests;
> 2) not pass requests immediately to the device, but keep them as long
> as needed, before finally handing them to the device.
>
> The driver could then use the window of requests, internally queued, to
> perform exactly the operations that it now performs with the
> collaboration of blk, such as command packing. blk-mq would be
> unchanged. If I'm not mistaken, this would match, at least in part,
> what some of you already proposed in more detail.
I think we have to be careful not to trade latency in one place
for a bigger latency in another place.
Right now, the handoff between blk and mmc introduces an inherent
latency in some cases, and blk-mq was designed to avoid that by
allowing minimizing the number of cpu cycles between the file
system and the hardware, as well as minimizing the depth of the
queue on the software side.
Having the driver do its own queuing (as dasd and mmc both do
today) is worse for both of the above, since you need extra
context switches for a single I/O with an empty queue, while
a full queue can add a lot of latency that is out of reach of
the I/O scheduler: a high-priority request can be moved ahead
of the block queue, but cannot bypass anything that is already
in a driver-internal queue.
The tradeoff in both cases is that we can prepare (build a
dasd channel program, or have dma_map_sg manage cache and
iommu) a new request while waiting for the previous one,
reducing the latency between two requests being worked on
by the hardware on devices without hardware queuing.
We clearly want to have both benefits as much as possible,
and having a ->prepare() callback is probably better here
than a longer private queue in the device driver.
With the packed commands on MMC, we have a degenerated queue,
as we would sometimes submit multiple blk requests together
as one MMC command. Here, advertizing a longer queue as I
described earlier may be the best option.
Arnd
next prev parent reply other threads:[~2017-01-03 23:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 14:01 [PATCH v2] RFD: switch MMC/SD to use blk-mq multiqueueing Linus Walleij
2016-12-20 16:21 ` Bartlomiej Zolnierkiewicz
2016-12-21 17:22 ` Ritesh Harjani
2016-12-27 12:21 ` Linus Walleij
2016-12-28 4:21 ` Ritesh Harjani
2016-12-28 8:55 ` Christoph Hellwig
2016-12-28 23:59 ` Linus Walleij
2017-01-02 9:40 ` Arnd Bergmann
2017-01-02 11:06 ` Hannes Reinecke
2017-01-02 11:58 ` Bart Van Assche
2017-01-02 17:08 ` Arnd Bergmann
2017-01-03 7:50 ` Paolo Valente
2017-01-03 23:06 ` Arnd Bergmann [this message]
2017-01-03 12:57 ` Linus Walleij
2017-01-02 11:55 ` Bart Van Assche
2017-01-03 12:59 ` Linus Walleij
2017-01-02 13:56 ` Adrian Hunter
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=3094495.7JvYrDVNM5@wuerfel \
--to=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=baolin.wang@linaro.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=paolo.valente@linaro.org \
--cc=riteshh@codeaurora.org \
--cc=ulf.hansson@linaro.org \
--cc=zhang.chunyan@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