From patchwork Thu Oct 26 12:57:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10028077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA4FA60567 for ; Thu, 26 Oct 2017 12:58:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBDC728DCD for ; Thu, 26 Oct 2017 12:58:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0D1828DF3; Thu, 26 Oct 2017 12:58:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC5928DEB for ; Thu, 26 Oct 2017 12:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932315AbdJZM6P (ORCPT ); Thu, 26 Oct 2017 08:58:15 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:51053 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932376AbdJZM6M (ORCPT ); Thu, 26 Oct 2017 08:58:12 -0400 Received: by mail-lf0-f67.google.com with SMTP id a132so3641889lfa.7 for ; Thu, 26 Oct 2017 05:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8vQbKvgu5n9TTja+C6GAMd1y73CvmPnbb2y1a2uC4ew=; b=EwEz9Voprnxp6C6MyA/PeRnwqHdo9kNQRLlfpxs0OJLpwDh5WsMs6s3MNBT84wEOyx Pxiu1MesejsUtIVeEddOPfe2TytyxarpjWSmn9uYyxwLRNFc4u7o/+4rYECOK5YPpTkA JP2dg997XoZ84khcrLFPv2e4niK4nzQaVQZI0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8vQbKvgu5n9TTja+C6GAMd1y73CvmPnbb2y1a2uC4ew=; b=S5PXllZh5MGju74EHtUj+bfj6zUfBLe74FdeAFJ1kHNAriyjkTH/pzmTBLDVqU5htr tZ/Xy6l19YahwzI8ma41FsJ6gwrNJD9lUYZmdOo/fTSW/jcIeNaluXyH7u5EXEv6iOZ7 X6EEAj0Qpm0kxdRZddNxK90oDWVNGfmGfrF7CjOMWgKvxzd/Cq0hKIH7Y5uCp9RiVqkV F21Dw7X1wj9LvNasVQX4hSSCTvtUezcIiDprZhFI1VV+fHGo3O6XHCa1tTdfjKt3/hFP lbmC4FsPRzKidVhOF1hpJ9A7P6jfwPN1DSb0xcKhyY0ETCukhQ9dUjG6Fi0chiILOdKV 98Lg== X-Gm-Message-State: AMCzsaVYG1IC0Bdeep0xwxo4h8H3OIAY9+JiEu8Rh5AzKvb2xV5NWppQ +01/kvwLPbi32INlsjMW2HPxzhGK37Y= X-Google-Smtp-Source: ABhQp+QJTdbsPTjAAnCVW11FhXAts12eK9o2WZZE+L8QHU87Kfcpjt4qr+zjMmfNRfhZ/AmjvqkJHg== X-Received: by 10.46.22.83 with SMTP id 19mr9419487ljw.147.1509022690846; Thu, 26 Oct 2017 05:58:10 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 34sm1165600lfr.25.2017.10.26.05.58.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 05:58:09 -0700 (PDT) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Bartlomiej Zolnierkiewicz , Paolo Valente , Avri Altman , Adrian Hunter , Linus Walleij Subject: [PATCH 01/12 v4] mmc: core: move the asynchronous post-processing Date: Thu, 26 Oct 2017 14:57:46 +0200 Message-Id: <20171026125757.10200-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171026125757.10200-1-linus.walleij@linaro.org> References: <20171026125757.10200-1-linus.walleij@linaro.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 12b271c2a912..3d1270b9aec4 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);