From patchwork Fri Nov 10 10:01:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10052731 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 B719D6035D for ; Fri, 10 Nov 2017 10:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A26802B23F for ; Fri, 10 Nov 2017 10:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 974852B24A; Fri, 10 Nov 2017 10:01:57 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 3F9B82B23F for ; Fri, 10 Nov 2017 10:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbdKJKBz (ORCPT ); Fri, 10 Nov 2017 05:01:55 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:51960 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbdKJKBx (ORCPT ); Fri, 10 Nov 2017 05:01:53 -0500 Received: by mail-lf0-f65.google.com with SMTP id f134so2109871lfg.8 for ; Fri, 10 Nov 2017 02:01:52 -0800 (PST) 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=eLY5CthlX10SDAKbYnppkdu75vU0SFr1NoPLjvOzlgk=; b=OTWGP+SfmdorcnalwnBjqFovdF3eR9Qr9o27n3pFhCwZIbY77CWQoV5MWNyYuTRNfZ rlDw19myeg1bSy91dNbi2WQLvcTJgWTfg6sPlYdBMRhrfKn+7v+6IeAIElOsO31gQizg Ih/q4rgEoJHxyrgmSTCRzujGGBED3mBjoau/4= 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=eLY5CthlX10SDAKbYnppkdu75vU0SFr1NoPLjvOzlgk=; b=V3uGNSxzSbMHOV4v9qIQxdFUOPwuCLmrSOk7y0Xq+fBdAiULi+tjC9Q6fTqYzhwAW0 Ry47B8vbaSDZwcb0K9ONTRNqBy0C9Gb02eK56RAb0vcQk1iHctpc+H9Aa+fFsl8/82Zd e3rMRnl2tGaS7zxmLysS5jvJ2HdMkoXRjfuJUTPDcsGZmZdkgDZGyn+Fb8kmkFHzNfrQ 81uzTv23hvSjsSSSbc3/6l3KD4F1Gr0hfcoLRO8tgeXSNN43d2yyMzMWwhLVDH359eHS Uw+/NzIirqAn9DvtZFb7x82/SZ1x0pOKhsUutNDa/rQ90ott+MilGFUCRHBblImQKd7x EZIg== X-Gm-Message-State: AJaThX52LEemtgUj4xy/xVWY/d0BXBj7lnsC3AA5SodPi51XNe4P+BbF Bx3h4kMK47BrlbjAcBNO+PBUBw== X-Google-Smtp-Source: AGs4zMaGGh3W+ewqoeOS3zVEeAEtMXR2/e3kBV/bHJ64UzZ/nqCrOeHurFBmsCNQHr5IXJ8vp/49Gw== X-Received: by 10.46.85.69 with SMTP id j66mr1377729ljb.137.1510308112010; Fri, 10 Nov 2017 02:01:52 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n36sm310843lfi.78.2017.11.10.02.01.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 02:01:51 -0800 (PST) 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 v5] mmc: core: move the asynchronous post-processing Date: Fri, 10 Nov 2017 11:01:32 +0100 Message-Id: <20171110100143.12256-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171110100143.12256-1-linus.walleij@linaro.org> References: <20171110100143.12256-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 --- 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);