Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1972800ybn; Thu, 26 Sep 2019 05:11:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqykCzw2G0948PM3jFlL2BF1tQkaOeUQDSXCz+8dbSRW1afKkN2r42WKoq2xuD5gdAJm8BfV X-Received: by 2002:a50:cfc7:: with SMTP id i7mr3093047edk.89.1569499875809; Thu, 26 Sep 2019 05:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569499875; cv=none; d=google.com; s=arc-20160816; b=p5MGk9xaU8eZzhJ1i1XVpuq66GkDqoJD0YgOXF2LuLpOtmJjQ2fmlynyyTbPWw58gt /uW6UZhfiLufhnoxjYJhRbW+No2Zxw6ZYb+sFjyEXxf+WG0xIHjjs/s5tqbup8/zc/sS 4g8uFd8j7wLJKZDs62ePGWR2gmZlHDD3urdd4A5Lj4XUyjhZs6uWKBKdMMSCQZ7ux6Gn tVOsDvUVnFedxOWrfRPj6+UNUbHHd/WGkbBgl3IypnZm2XuDd8oC4ocF2JKaM7/gJZWW PemM+94brFnqX7avhXVAyj0h426jTai/0k5pL2ahO0fipuRNI14HaFMWTEW6R3McRbey pmiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=USWLxFgs7E4KkZvAAFYRfPROq/+pYFOTAksxz7/eFbE=; b=lIcCkevlT41m2m04MRX94orVSq0U1GfEdBJynXw5fgi4Yi2pt/QJm7T8BLuaXPpWdv JGihTzMI4tOybdMnZvTdU/H5f2CCBKJzzlGkuwkILUKe4UkWW6DVEL2LoSYv0sTZEIqr PfWaqOrYXIRyr63iuT42fPLp/KgHprQcF27C78mdHhXjmHR9KZRk2UqRIJEbWNMlASZG GyP5b1lyw4hJvi40FcEPvJV+U1ddxI0g3j4UPqW6LHxpoya2VjaQGeGpZme3cKUqoX0o QnMh6PxcFhkbEubVbTwhU09OvnJEeyE3Xc5fuUB+Z9I9pGgUI+XOZ32B7LY5bDSvy+OE XofQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si853669ejc.366.2019.09.26.05.10.50; Thu, 26 Sep 2019 05:11:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbfIZMIp (ORCPT + 99 others); Thu, 26 Sep 2019 08:08:45 -0400 Received: from mga14.intel.com ([192.55.52.115]:10523 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbfIZMIp (ORCPT ); Thu, 26 Sep 2019 08:08:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 05:08:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,551,1559545200"; d="scan'208";a="341225012" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.66]) ([10.237.72.66]) by orsmga004.jf.intel.com with ESMTP; 26 Sep 2019 05:08:41 -0700 Subject: Re: [PATCH v3 0/3] Add MMC software queue support To: Baolin Wang , Ulf Hansson , asutoshd@codeaurora.org Cc: Orson Zhai , Chunyan Zhang , Arnd Bergmann , Linus Walleij , Vincent Guittot , linux-mmc , LKML References: From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Thu, 26 Sep 2019 15:07:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/09/19 12:43 PM, Baolin Wang wrote: > Hi Adrian and Ulf, > > On Thu, 19 Sep 2019 at 13:59, Baolin Wang wrote: >> >> Hi All, >> >> Now the MMC read/write stack will always wait for previous request is >> completed by mmc_blk_rw_wait(), before sending a new request to hardware, >> or queue a work to complete request, that will bring context switching >> overhead, especially for high I/O per second rates, to affect the IO >> performance. >> >> Thus this patch set will introduce the MMC software command queue support >> based on command queue engine's interfaces, and set the queue depth as 2, >> that means we do not need wait for previous request is completed and can >> queue 2 requests in flight. It is enough to let the irq handler always >> trigger the next request without a context switch and then ask the blk_mq >> layer for the next one to get queued, as well as avoiding a long latency. >> >> Moreover we can expand the MMC software queue interface to support >> MMC packed request or packed command instead of adding new interfaces, >> according to previosus discussion. >> >> Below are some comparison data with fio tool. The fio command I used >> is like below with changing the '--rw' parameter and enabling the direct >> IO flag to measure the actual hardware transfer speed in 4K block size. >> >> ./fio --filename=/dev/mmcblk0p30 --direct=1 --iodepth=20 --rw=read --bs=4K --size=512M --group_reporting --numjobs=20 --name=test_read >> >> My eMMC card working at HS400 Enhanced strobe mode: >> [ 2.229856] mmc0: new HS400 Enhanced strobe MMC card at address 0001 >> [ 2.237566] mmcblk0: mmc0:0001 HBG4a2 29.1 GiB >> [ 2.242621] mmcblk0boot0: mmc0:0001 HBG4a2 partition 1 4.00 MiB >> [ 2.249110] mmcblk0boot1: mmc0:0001 HBG4a2 partition 2 4.00 MiB >> [ 2.255307] mmcblk0rpmb: mmc0:0001 HBG4a2 partition 3 4.00 MiB, chardev (248:0) >> >> 1. Without MMC software queue >> I tested 3 times for each case and output a average speed. >> >> 1) Sequential read: >> Speed: 28.9MiB/s, 26.4MiB/s, 30.9MiB/s >> Average speed: 28.7MiB/s >> >> 2) Random read: >> Speed: 18.2MiB/s, 8.9MiB/s, 15.8MiB/s >> Average speed: 14.3MiB/s >> >> 3) Sequential write: >> Speed: 21.1MiB/s, 27.9MiB/s, 25MiB/s >> Average speed: 24.7MiB/s >> >> 4) Random write: >> Speed: 21.5MiB/s, 18.1MiB/s, 18.1MiB/s >> Average speed: 19.2MiB/s >> >> 2. With MMC software queue >> I tested 3 times for each case and output a average speed. >> >> 1) Sequential read: >> Speed: 44.1MiB/s, 42.3MiB/s, 44.4MiB/s >> Average speed: 43.6MiB/s >> >> 2) Random read: >> Speed: 30.6MiB/s, 30.9MiB/s, 30.5MiB/s >> Average speed: 30.6MiB/s >> >> 3) Sequential write: >> Speed: 44.1MiB/s, 45.9MiB/s, 44.2MiB/s >> Average speed: 44.7MiB/s >> >> 4) Random write: >> Speed: 45.1MiB/s, 43.3MiB/s, 42.4MiB/s >> Average speed: 43.6MiB/s >> >> Form above data, we can see the MMC software queue can help to improve the >> performance obviously. >> >> Any comments are welcome. Thanks a lot. >> >> Changes from v2: >> - Remove reference to 'struct cqhci_host' and 'struct cqhci_slot', >> instead adding 'struct sqhci_host', which is only used by software queue. >> >> Changes from v1: >> - Add request_done ops for sdhci_ops. >> - Replace virtual command queue with software queue for functions and >> variables. >> - Rename the software queue file and add sqhci.h header file. > > Do you have any comments for this patch set except the random config > building issue that will be fixed in the next version? Thanks. Pedantically, swhci is not a host controller interface, so the name still seems inappropriate. Otherwise I haven't had time to look at it, sorry. > >> >> Baolin Wang (3): >> mmc: Add MMC software queue support >> mmc: host: sdhci: Add request_done ops for struct sdhci_ops >> mmc: host: sdhci-sprd: Add software queue support >> >> drivers/mmc/core/block.c | 61 ++++++++ >> drivers/mmc/core/mmc.c | 13 +- >> drivers/mmc/core/queue.c | 25 ++- >> drivers/mmc/host/Kconfig | 9 ++ >> drivers/mmc/host/Makefile | 1 + >> drivers/mmc/host/sdhci-sprd.c | 26 ++++ >> drivers/mmc/host/sdhci.c | 12 +- >> drivers/mmc/host/sdhci.h | 2 + >> drivers/mmc/host/sqhci.c | 344 +++++++++++++++++++++++++++++++++++++++++ >> drivers/mmc/host/sqhci.h | 53 +++++++ >> include/linux/mmc/host.h | 3 + >> 11 files changed, 537 insertions(+), 12 deletions(-) >> create mode 100644 drivers/mmc/host/sqhci.c >> create mode 100644 drivers/mmc/host/sqhci.h >> >> -- >> 1.7.9.5 >> > >