Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3370896ybl; Sun, 11 Aug 2019 22:22:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnTeMcx+cih/jdEfWRZ5nuNgnEJUNWwEBmvSWUlBtm1NYEcGc2HFYJjThGJBFtwxX5Z0I5 X-Received: by 2002:a17:90a:19c2:: with SMTP id 2mr21053535pjj.13.1565587332720; Sun, 11 Aug 2019 22:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565587332; cv=none; d=google.com; s=arc-20160816; b=IrH1EY66ccQajLi7thyXk9FVDp4F533xbxN6oEQfECGD2KS28La7e3gKU4D3/nmx8q rXlXsSISLvv7Y3Tc07u4SUkAGxumQVlJfxvNvv0GmKKwkGZMOTZIQKKnrorHbaYZ5qhl aypvKwZzKtpQEV/VRSMTefQZRfl0XruUEL3ZsaMV5SLQFjCqvfLYdl96UAOXh2xyKzRP tB3xZwcwUxnFWLO2A4wl3vCWTWCxB2RSuf0ZSRjcrZcNj/Gs3crduHU3qQrA9orYzPAq E543rU35wPjT1g/o7TfkI1pawKgXyuBHb29HbfXmBjV4zj8j2c4E5bGnoVx0Tx0UTgD7 ayDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NNApVqLDhxhV5GW+zjfatyr91CgCXJ+9+OYZrhYmN0Q=; b=TGClZvQuWfgZKHwuBVWdCZiNCzMlR/w0zXiWnsvL763I30Ra0c7oBOd4pQmSVPrqgb pJSgX2LyBcrMgitwblA/vGZhdC3LC/r/y7dEYT9YeEOCdliFpOyOzGPjMHT4WR3nUsgy 5ZxrlJb4zuw2BwoL9AQJ+RaUfPd/xksT25x6nhtSzpn8W6LI+Ckdk9hg4BvXNGhOjtes wp57oE0UxshhB1o5ZMmTobLkVVrZVmI0yBjlJoXWaObu1nA62hKo+AIC5yWndxacZErP QcYRwrjY55l5tGGUnaUiWRgqDwipYh6y0AOdm8o+FEOud6WDGJKplN1361n2yqMAVg1f 1aSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GZMjNpkN; 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=pass (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 c35si52017897pgm.51.2019.08.11.22.21.44; Sun, 11 Aug 2019 22:22:12 -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; dkim=pass header.i=@linaro.org header.s=google header.b=GZMjNpkN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfHLFUs (ORCPT + 99 others); Mon, 12 Aug 2019 01:20:48 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:32957 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbfHLFUs (ORCPT ); Mon, 12 Aug 2019 01:20:48 -0400 Received: by mail-ot1-f66.google.com with SMTP id q20so1717016otl.0 for ; Sun, 11 Aug 2019 22:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NNApVqLDhxhV5GW+zjfatyr91CgCXJ+9+OYZrhYmN0Q=; b=GZMjNpkNtxbv5PiNrferR3A8fwAHY/VcpmdZARBlA76B2M92CFLkLkNykU1a7MUxEM gf5KI4t+UMfh9YZc1CBtJTUKYN1bzpAX3O1aZgmt0t//8ciWbiPdScaO8I5odj227eKa aqbJQSGPXHWV6cKG58qpbARELDufXd5JCj1f7rmT98kUIJfelJNs3fQbFgksRz8/gLHN H9iQlsG2MDvF2uzYw/96/Bu9zoCXKJbhMV2wvHK/yYPaYxw7ydvULdMby9ux5Xjk5lyo 0WOzTn7t77IeKH8rylwRvNnOAvdz4IODRHMpHIOxdl/eCcXX5K6VRnU8BWKh4/X86gVx 2OpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NNApVqLDhxhV5GW+zjfatyr91CgCXJ+9+OYZrhYmN0Q=; b=CnMXiCALzaF2S9OaIyMvVvaec4DmujXgayPYHB9b312OOJAw6PMaJWD4AiO+DCut28 E3Fn5o2zqviClBF1/bWnTneVJwR88omogxkSNEga9kfT0OZvnTxQFpJ3WrwEBvfLM/W7 YETLRbVmwqWGQUe/qbRklbzzjf1b5zSHg2+J7dygQ74DPQhzeXBxbnRhitN8y0woTjJt mK/+Hs66EPisIJoOQQ9KVAWvh37LL/w96qduh/fX90WTNwrZ8gaxqXPCiPeB3KbJuFiv ZTl+wwrLCyu7vooPgwpzCzcCPvXeKdXu10bYQERzh+2cjp240pBVqn3K2aM8R1MXiBKs nRFg== X-Gm-Message-State: APjAAAWeKibkB7W6MOkY+UaasV60z4claHX+hd/pIssguoxG9gk0146T D2W9t5k6J+UPVT7zYgpPh9j8+uAboFjjaG0RK+7Etw== X-Received: by 2002:a9d:590d:: with SMTP id t13mr18440283oth.281.1565587246724; Sun, 11 Aug 2019 22:20:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Baolin Wang Date: Mon, 12 Aug 2019 13:20:35 +0800 Message-ID: Subject: Re: [RFC PATCH 0/7] Add MMC packed function To: Jens Axboe , Adrian Hunter , Ulf Hansson Cc: Chunyan Zhang , Orson Zhai , Arnd Bergmann , Linus Walleij , Vincent Guittot , linux-mmc , LKML , linux-block@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, 22 Jul 2019 at 21:10, Baolin Wang wrote: > > Hi All, > > Now some SD/MMC controllers can support packed command or packed request, > that means it can package multiple requests to host controller to be handled > at one time, which can improve the I/O performence. Thus this patchset is > used to add the MMC packed function to support packed request or packed > command. > > In this patch set, I implemented the SD host ADMA3 transfer mode to support > packed request. The ADMA3 transfer mode can process a multi-block data transfer > by using a pair of command descriptor and ADMA2 descriptor. In future we can > easily expand the MMC packed function to support packed command. > > Below are some comparison data between packed request and non-packed request > 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. > > ./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. Non-packed request > 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. Packed request > In packed request mode, I set the host controller can package maximum 10 > requests at one time (Actually I can increase the package number), and I > enabled read/write packed request mode. Also I tested 3 times for each > case and output a average speed. > > 1) Sequential read: > Speed: 165MiB/s, 167MiB/s, 164MiB/s > Average speed: 165.3MiB/s > > 2) Random read: > Speed: 147MiB/s, 141MiB/s, 144MiB/s > Average speed: 144MiB/s > > 3) Sequential write: > Speed: 87.8MiB/s, 89.1MiB/s, 90.0MiB/s > Average speed: 89MiB/s > > 4) Random write: > Speed: 90.9MiB/s, 89.8MiB/s, 90.4MiB/s > Average speed: 90.4MiB/s > > Form above data, we can see the packed request can improve the performance greatly. > Any comments are welcome. Thanks a lot. Any comments for this patch set? Thanks. > > Baolin Wang (7): > blk-mq: Export blk_mq_hctx_has_pending() function > mmc: core: Add MMC packed request function > mmc: host: sdhci: Introduce ADMA3 transfer mode > mmc: host: sdhci: Factor out the command configuration > mmc: host: sdhci: Remove redundant sg_count member of struct > sdhci_host > mmc: host: sdhci: Add MMC packed request support > mmc: host: sdhci-sprd: Add MMC packed request support > > block/blk-mq.c | 3 +- > drivers/mmc/core/Kconfig | 2 + > drivers/mmc/core/Makefile | 1 + > drivers/mmc/core/block.c | 71 +++++- > drivers/mmc/core/block.h | 3 +- > drivers/mmc/core/core.c | 51 ++++ > drivers/mmc/core/core.h | 3 + > drivers/mmc/core/packed.c | 478 ++++++++++++++++++++++++++++++++++++++ > drivers/mmc/core/queue.c | 28 ++- > drivers/mmc/host/Kconfig | 1 + > drivers/mmc/host/sdhci-sprd.c | 22 +- > drivers/mmc/host/sdhci.c | 513 +++++++++++++++++++++++++++++++++++------ > drivers/mmc/host/sdhci.h | 59 ++++- > include/linux/blk-mq.h | 1 + > include/linux/mmc/core.h | 1 + > include/linux/mmc/host.h | 3 + > include/linux/mmc/packed.h | 123 ++++++++++ > 17 files changed, 1286 insertions(+), 77 deletions(-) > create mode 100644 drivers/mmc/core/packed.c > create mode 100644 include/linux/mmc/packed.h > > -- > 1.7.9.5 > -- Baolin Wang Best Regards