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: 117222 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp733101qgn; Thu, 26 Oct 2017 05:58:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Se1SAKKsSzkTlr920Wrp2qbyYRdrLUSz82UZqQOorkII+zn07g3zr65UEmrwHgLcmAhktk X-Received: by 10.98.214.76 with SMTP id r73mr5274214pfg.261.1509022695776; Thu, 26 Oct 2017 05:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509022695; cv=none; d=google.com; s=arc-20160816; b=UdIZ3Ne6OaEoYhJ4srRi8XJR21ow/nmZB+P97j4BNKQaXkLfgLfpINggNVdFK7w5EK VVR1kVXRImXavxzmjDtHZlLBGqawtpUFMNPCNlcFBhYpgRocjkCO3oUF8mMmov3adUjF ltuQm0DhbEpY2VShCweBLblFk0q1DYPbKSEZPWT3i0XjJQ8rNSLJPd8/xnF0kYVFtkvu EdcR3PIONI8Sp35652emo6wVIMydjK/BFPT2FjKyukiFCl++cKNHCabhZVLLM4P0sElX /wPfi05nP5d9vTUgxnFmIKeYEknhNtWfYWsUZSzCryhDBLjXkB3P0UCb2ZSkg/awLuyp fajA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=k+SDcUMr26sped1BCQAW9l42oXtVIDkfRM3FQSruy60=; b=NbLqGxhDLvTIrISpIrc1wL8EL1nVe1q6ud20jfWKbq9OGoJTeaAAEYu4IdoUpLGqc0 JXnFdLOlsNpso4MpQGss2eRioepqyy3HvPMnNQuMzB2h3G9Qq/IxTIVO7GuIlWP8aEK1 MZ5j0Urdcgz9lw88KcIhiC1WfrKWE6CNLUHLJA8vCTpVpkBh17C804i/vdHFSphQkOU5 osX3N4V7aH7loHcVAKB/Knm2zU27kdGSXi/a/kvxFzWttq2bVLtONTqyE+E7GP8+LeJd y41Pl96SGLS3cRBaHYLS28+tGAXRGj3AASL8IbJuZnitXwPawc91Zvd/jETyEPGQ9q7E e0Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EwEz9Vop; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si3605289pff.367.2017.10.26.05.58.15; Thu, 26 Oct 2017 05:58:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EwEz9Vop; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbdJZM6O (ORCPT + 6 others); Thu, 26 Oct 2017 08:58:14 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:45022 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932377AbdJZM6M (ORCPT ); Thu, 26 Oct 2017 08:58:12 -0400 Received: by mail-lf0-f66.google.com with SMTP id 75so3657894lfx.1 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=PfRZVi9AhnPlqWnNUOyUA81mmWHqa08gm/pK5phZjBoWMC3s+DHWlvbqOUp3544QAm GhQ12+cAtAh+pHGEtvwujjNq6Q0qfhuxDsNg6Qfyhdsk4M9nkaW1Ee2sBN0AT5f9vu9V Dvl/C4joBBPETxkCs1KWKYgWI56nlT+D60wnef1BwUAhREcEq70zNn3LeKSk00fsQjf7 JZdSXhv5Thvp1x96Smc0zQ3LKg16W5JmG7utNozjdzQy+0SfvZRMn5R2Qq3BYmXU02Wz k+QKA7e+pgAaMhP1ivRflEwRGH6AODPo5lA3sxUH4l1DROfEX5hHn7K4SveGRDVGrbhL IYdw== X-Gm-Message-State: AMCzsaUuMCI6Bgv4GetLZ1CWRoS8rgcptFXP9neBmSxy8dK4nHC4HpqA EFFra/jdJRhjzaSb9eZjJcgeAl1dLLY= 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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 --- drivers/mmc/core/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);