public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: 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>,
	Paolo Valente <paolo.valente@linaro.org>
Subject: Re: [PATCH v2] RFD: switch MMC/SD to use blk-mq multiqueueing
Date: Mon, 02 Jan 2017 10:40:15 +0100	[thread overview]
Message-ID: <2360959.cyJgAELf50@wuerfel> (raw)
In-Reply-To: <CACRpkdb2zyjRz_zniT5nLxWCeLwagn1ZiTWwXc6bHW229NmfPQ@mail.gmail.com>

On Thursday, December 29, 2016 12:59:51 AM CET Linus Walleij wrote:
> On Wed, Dec 28, 2016 at 9:55 AM, Christoph Hellwig <hch@lst.de> wrote:
> > On Tue, Dec 27, 2016 at 01:21:28PM +0100, Linus Walleij wrote:
> 
> >> On the contrary we expect a performance regression as mq has no
> >> scheduling. MQ is created for the usecase where you have multiple
> >> hardware queues and they are so hungry for work that you have a problem
> >> feeding them all. Needless to say, on eMMC/SD we don't have that problem
> >> right now atleast.
> >
> > That's not entirely correct.  blk-mq is designed to replace the legacy
> > request code eventually.  The focus is on not wasting CPU cycles, and
> > to support multiple queues (but not require them).
> 
> OK! Performance is paramount, so this indeed confirms that we need
> to re-engineer the MMC/SD stack to not rely on this kthread to "drive"
> transactions, instead we need to complete them quickly from the driver
> callbacks and let MQ drive.
> 
> A problem here is that issueing the requests are in blocking context
> while completion is in IRQ context (for most drivers) so we need to
> look into this.

I think whether issuing an mmc request requires blocking should ideally
be up to the host device driver, at least I'd hope that we can end up
with something like this driving latency to the absolute minimum:

a) with MMC CMDQ support:
  - report actual queue depth
  - have blk-mq push requests directly into the device through
    the mmc-block driver and the host driver
  - if a host driver needs to block, make it use a private workqueue

b) without MMC CMDQ support:
  - report queue depth of '2'
  - first request gets handled as above
  - if one request is pending, prepare the second request and
    add a pointer to the mmc host structure (not that different
    from what we do today)
  - when the host driver completes a request, have it immediately
    issue the next one from the interrupt handler. In case we need
    to sleep here, use a threaded IRQ, or a workqueue. This should
    avoid the need for the NULL requests

c) possible optimization for command packing without CMDQ:
   - similar to b)
   - report a longer queue (e.g. 8, maybe user selectable, to
     balance throughput against latency)
   - any request of the same type (read or write) as the one that
     is currently added to the host as the 'next' one can be
     added to that request so they get issued together
   - if the types are different, report the queue to be busy

	Arnd

  reply	other threads:[~2017-01-02  9:40 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 [this message]
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
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=2360959.cyJgAELf50@wuerfel \
    --to=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linaro.org \
    --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