Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3669798ybl; Mon, 12 Aug 2019 04:31:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5JRG72rfmGfRAqXGXnUqLqeBpOMcwUYPeera+qk8rPx4DYMk/rapbvj26yZRy9QyWPfEG X-Received: by 2002:a17:90a:db0d:: with SMTP id g13mr1215062pjv.51.1565609476076; Mon, 12 Aug 2019 04:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565609476; cv=none; d=google.com; s=arc-20160816; b=JPyhU+oOkNGokhbCSdYJBEJKk1wCZW7M/IN44v6za7iccT+t575ITLbDBuedHd3Uo+ ae5IVs+YGjYgiyDy4IdAyH9QaNzDKzU0ScHri8walzO1Z2NriCLqZBeO0N+3fFhrn97u PfL4mSrtZp+rXHrIL7vQB51nmilyp47kmHT7jOZM8z1jS84IMBJNR4b89EMjCeD1pGnQ 1cutr0cLU6aOPIbqEYq6SfX8UMPQz3sUXiKnLvq0cARWBc9L6dUU604afhpDSnZhtMQO 6QmKqtrMfOz2+3Je4X+tOlXWyNNLF8Iqp2RSckjGp3wbjcI8zQUJyRPH8HKWJO+tzISt EiSQ== 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=V+ux4MbUXgqf1gwWmYXXzaPeUghjvJ0johGkJTmaSek=; b=qWr70nyJYl69jfGXMkONx2kQWBMqEme57AMmosOCUkStIL7Sg9UBOr3GasuzQX8AH5 lHx+biiInoaeEJq6tvklMHJidYOw8wsAdGk/nGFVIXi7D9YP+uOSBxRXRyTuZnjqTXBi 5ZkWgiVKrfmp8P6Z1gy5bABE6FCaINL73+QNOU1zTwODH55Du8uUPlSZqs7xmHHNx/Rm aFu/H/wPwhEc1szV1R/ys8fWg+KCsZG+n9l3Y2KRwi/D5O92rGPloHprTPFPP6IaM8++ JidvIatemNGvqWBpbbIgFYjzvMh5FAmYIsJu0whwLcqykNqOmYKjo86PuY1xRQ4tzl54 onfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muzVqKcG; 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 v24si64260707pgk.509.2019.08.12.04.31.01; Mon, 12 Aug 2019 04:31:16 -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=muzVqKcG; 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 S1728396AbfHLLaG (ORCPT + 99 others); Mon, 12 Aug 2019 07:30:06 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:43147 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728315AbfHLLaF (ORCPT ); Mon, 12 Aug 2019 07:30:05 -0400 Received: by mail-ot1-f65.google.com with SMTP id e12so13118079otp.10 for ; Mon, 12 Aug 2019 04:30:05 -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=V+ux4MbUXgqf1gwWmYXXzaPeUghjvJ0johGkJTmaSek=; b=muzVqKcG1BVARehU8wDBShgz4+qNIYwWr3V0i7sNzT7g93wFTnbE5ojtrf4tEj1QFK cpTaupKUiOxTmh3rUz/giDmwdlanEajGLsziU/bhPZ2EM+VcLlfDXe6yNMERQkos7ukq JXhNxY8PJDL+S30el6Nr/udO4pBQ7Evmrv4V4fnmaReCzCjKEkEP1Vc1gmtd8q1D+2iL rESVICyrlBydcT7WlLDDM4EscppAn7WhIDWvlDftSfrE4LaQM6R4FTJjsRGNNUpfTFhu tAhpGIRK+SkkWD1/xYV+0GVxHXWi5/8tUS7WRUJOi8r+b6Hm9H//xZQpEtm5laVYzOCx l4oA== 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=V+ux4MbUXgqf1gwWmYXXzaPeUghjvJ0johGkJTmaSek=; b=HlMEQULx2e19jHQsSAJVXCFhH1hCT/4mpUDuhCVPcIRSuYTJLAqerpho4/jBeNgF4n Bl3d3XWrOAJWT68wR6C8KCg3zbI1INuLSyhaean4rShmrPU6yCMpzjI0czljZpkq4pi5 /Dcle05kvaoF+8+eN7v5DsAFPGDJsijwLoQ8MPsgeujmT7jwocV+4Mb5iLVsIb3slwQQ SDDzWrtwbLteeWb7qkzetIpwf0zr8yCKfDGhGDve3SIoreNlhMmTiyUfYtFPuF4753XG 2qLcFFvnAwwkhatR3SdDG/F/KWbuXv1o2gqxFQMcjVzkoT0anFR73eIVsZPp5IY2cOzs vRbQ== X-Gm-Message-State: APjAAAXtARzDhx51omDh8LF9ZcpdHVmusLt5PWhy1zQyKuD7VDUryc8N yamRk2qLxaSxViQJqZGure2VGWu+WBwdRLHWmi+xTg== X-Received: by 2002:a05:6830:1e05:: with SMTP id s5mr14601568otr.247.1565609404989; Mon, 12 Aug 2019 04:30:04 -0700 (PDT) MIME-Version: 1.0 References: <8abff7d6-0a3e-efe7-e8ec-9309fada9121@intel.com> <8e447a05-a859-5c71-911f-b5a0a907e8a0@intel.com> In-Reply-To: <8e447a05-a859-5c71-911f-b5a0a907e8a0@intel.com> From: Baolin Wang Date: Mon, 12 Aug 2019 19:29:47 +0800 Message-ID: Subject: Re: [RFC PATCH 0/7] Add MMC packed function To: Adrian Hunter Cc: Jens Axboe , Ulf Hansson , 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 On Mon, 12 Aug 2019 at 18:52, Adrian Hunter wrote: > > On 12/08/19 12:44 PM, Baolin Wang wrote: > > Hi Adrian, > > > > On Mon, 12 Aug 2019 at 16:59, Adrian Hunter wrote: > >> > >> On 12/08/19 8:20 AM, Baolin Wang wrote: > >>> 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 > >> > >> This seems surprising low for a HS400ES card. Do you know why that is? > > > > I've set the clock to 400M, but it seems the hardware did not output > > the corresponding clock. I will check my hardware. > > > >>>> > >>>> 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. > >> > >> Did you consider adapting the CQE interface? > > > > I am not very familiar with CQE, since my controller did not support > > it. But the MMC packed function had introduced some callbacks to help > > for different controllers to do packed request, so I think it is easy > > to adapt the CQE interface. > > > > I meant did you consider using the CQE interface instead of creating another > one? Sorry for misunderstanding. I think the core/core.c modification can use the CQE interface, but there are some difference in core/block.c, and I think they are different mechanisms, also I want to keep avoid affecting CQE and normal transfer, so I think adding MMC packed related interfaces will be easy to read and maintain. -- Baolin Wang Best Regards