All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Arnd Bergmann <arnd@arndb.de>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Paolo Valente <paolo.valente@linaro.org>,
	Avri Altman <Avri.Altman@sandisk.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 01/12 v5] mmc: core: move the asynchronous post-processing
Date: Fri, 10 Nov 2017 11:01:32 +0100	[thread overview]
Message-ID: <20171110100143.12256-2-linus.walleij@linaro.org> (raw)
In-Reply-To: <20171110100143.12256-1-linus.walleij@linaro.org>

This moves the asynchronous post-processing of a request over
to the finalization function.

The patch has a slight semantic change:

Both places will be in the code path for if (host->areq) and
in the same sequence, but before this patch, the next request
was started before performing post-processing.

The effect is that whereas before, the post- and preprocessing
happened after starting the next request, now the preprocessing
will happen after the request is done and before the next has
started which would cut half of the pre/post optimizations out.

In the later patch named "mmc: core: replace waitqueue with
worker" we move the finalization to a worker started by
mmc_request_done() and in the patch named
"mmc: block: issue requests in massive parallel" we introduce
a forked success/failure path that can quickly complete
requests when they come back from the hardware.

These two later patches together restore the same optimization
but in a more elegant manner that avoids the need to flush the
two-stage pipleline with NULL, something we remove between these
two patches in the commit named
"mmc: queue: stop flushing the pipeline with NULL".

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v5:
- Rebasing on the "next" branch in the MMC tree.
---
 drivers/mmc/core/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 1f0f44f4dd5f..e2366a82eebe 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -746,6 +746,9 @@ static enum mmc_blk_status mmc_finalize_areq(struct mmc_host *host)
 		mmc_start_bkops(host->card, true);
 	}
 
+	/* Successfully postprocess the old request at this point */
+	mmc_post_req(host, host->areq->mrq, 0);
+
 	return status;
 }
 
@@ -790,10 +793,6 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,
 	if (status == MMC_BLK_SUCCESS && areq)
 		start_err = __mmc_start_data_req(host, areq->mrq);
 
-	/* Postprocess the old request at this point */
-	if (host->areq)
-		mmc_post_req(host, host->areq->mrq, 0);
-
 	/* Cancel a prepared request if it was not started. */
 	if ((status != MMC_BLK_SUCCESS || start_err) && areq)
 		mmc_post_req(host, areq->mrq, -EINVAL);
-- 
2.13.6

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

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171110104657epcas1p278e62237982d200175480c28080cb708@epcas1p2.samsung.com>
2017-11-10 10:01 ` [PATCH 00/12 v5] Multiqueue for MMC/SD Linus Walleij
2017-11-10 10:01   ` Linus Walleij [this message]
2017-11-10 10:01   ` [PATCH 02/12 v5] mmc: core: add a workqueue for completing requests Linus Walleij
2017-11-10 10:01   ` [PATCH 03/12 v5] mmc: core: replace waitqueue with worker Linus Walleij
2017-11-10 10:01   ` [PATCH 04/12] mmc: core: do away with is_done_rcv Linus Walleij
2017-11-10 10:01   ` [PATCH 05/12] mmc: core: do away with is_new_req Linus Walleij
2017-11-10 10:01   ` [PATCH 06/12 v5] mmc: core: kill off the context info Linus Walleij
2017-11-10 10:01   ` [PATCH 07/12 v5] mmc: queue: simplify queue logic Linus Walleij
2017-11-10 10:01   ` [PATCH 08/12 v5] mmc: block: shuffle retry and error handling Linus Walleij
2017-11-10 10:01   ` [PATCH 09/12 v5] mmc: queue: stop flushing the pipeline with NULL Linus Walleij
2017-11-10 10:01   ` [PATCH 10/12 v5] mmc: queue/block: pass around struct mmc_queue_req*s Linus Walleij
2017-11-10 10:01   ` [PATCH 11/12 v5] mmc: block: issue requests in massive parallel Linus Walleij
2017-11-10 10:01   ` [PATCH 12/12 v5] mmc: switch MMC/SD to use blk-mq multiqueueing v5 Linus Walleij
2017-11-10 13:39   ` [PATCH 00/12 v5] Multiqueue for MMC/SD Linus Walleij
2017-11-10 15:24   ` Ulf Hansson
2017-11-14 21:17     ` Linus Walleij
2017-11-15 10:24       ` Ulf Hansson
2017-11-15 13:50       ` Adrian Hunter
2017-11-29 13:13         ` Linus Walleij
2017-11-14 12:17   ` Bartlomiej Zolnierkiewicz
2017-11-14 13:30     ` Bartlomiej Zolnierkiewicz
2017-11-14 21:19       ` Linus Walleij

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=20171110100143.12256-2-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=Avri.Altman@sandisk.com \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=b.zolnierkie@samsung.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=ulf.hansson@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.