Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3191595ybn; Fri, 27 Sep 2019 02:34:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwE8MhANnX/8toVL0w5THbJpor3Qg49n5brPL0OXMKtDn03tum4cUrjfui9dwuGykNZqty+ X-Received: by 2002:a50:aa96:: with SMTP id q22mr3379021edc.179.1569576840270; Fri, 27 Sep 2019 02:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569576840; cv=none; d=google.com; s=arc-20160816; b=KBz/wmTl1ILoNUuqYAmng87EVSfvQHrPAWkOvNAMMI4D6htWliOh3FO5haahPKbIT/ 3YJN5YlF+iqz1iG6useKXO6I4v2FPQIVvQ631hQc/UrD3EmUuJVfWxy4nzcL8VnyJM6+ 4Ri//unRvnknqBP0nWWSyY23DnkqCyat06IpCVrIsxrw+aXC4TVkPuWIqs7exCXdum31 kgUE8IknuSBRc0vYoZYVdfVQ1sujATrn0mXeoUFDrYE4gP8D+Geu4zVi9IDr6spX4ggX Su3BKbN8czVD/IyEcEPFy43jcxTcnTkHJEN0wx8HQu3kyXmPAFw/fcbUYgwhD2hwomxx n43A== 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=iBKBSoCXyPsaFcR3Bk4+exS1wpAq9IzVjY6FOFa5Qus=; b=FwQP5Sdh3x7TOSKbaDB5yuQhWAhqVebHwH6famPe/3nLjsIv2GSxjjmSegAN+QkjPZ SHvR4u6q1erjziJRN1RL+LlRQMfyNAA7TtUeAocogNCX1pSQQpDRfQxtI5fQ5ovC6BSl nkg40YaKASLbJaAEeLyvK3LdZvkVViVWHLgzp3FWPZSh5fx9f4g9Lyovdw9u8YamJpYB SiQLRaT9P5wwffGYWiWHhnxDwJ6t3wH4cHd8Z3tfKnVIE6yxNkbjeuOeyRFONLuy+DcP geiFl4mvLgxcLux11QncqtrrHGDUzOWt+kujTVz+ElVRcKSF0ZjGvA0r6k4UDG88GmKO 0bgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rbx4msmh; 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 i10si1212125ede.101.2019.09.27.02.33.34; Fri, 27 Sep 2019 02:34:00 -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=rbx4msmh; 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 S1726144AbfI0JdT (ORCPT + 99 others); Fri, 27 Sep 2019 05:33:19 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40854 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfI0JdT (ORCPT ); Fri, 27 Sep 2019 05:33:19 -0400 Received: by mail-lj1-f195.google.com with SMTP id 7so1816775ljw.7 for ; Fri, 27 Sep 2019 02:33:16 -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=iBKBSoCXyPsaFcR3Bk4+exS1wpAq9IzVjY6FOFa5Qus=; b=rbx4msmhxYJrSCYeNkekKBwHoxx5KbgI9AAebr77wDShVXeXn9yKVTm5T+zxZQtib/ preBoc0nFg9dtEimugwYKTuM+TJP7koWNzuUqtUApTY2zAqPYPOHhE7WC9EZomYOkVE6 pM9qNFLCvNMj4fkvSFkm+6L3luXxl0XI4LRmq5nxwqnv9RjCNTi5FJQ10Rt3NlYtSCrn 4J06yKorKbpOuKUcVXNU2yamj9bU3/GF9ar2lh8wxUAgmwJa+lrowGvxi6xmBfIT/De6 GHgzJwjvnWmbDOPb6pyObvfrBTOmCdDhfSu3CyPIyxO1Jw94U4N8kM8RKbYYHjnavDNg V/JA== 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=iBKBSoCXyPsaFcR3Bk4+exS1wpAq9IzVjY6FOFa5Qus=; b=Mvt12vH1sdz5fKH38Ngy67vsmZ2DckISaQDXRMj+HCCxS+iDqNcEkpDPyu12OniQr7 mdlrUsjjAzvjQVQsnPF04+7HheBDS/diqfgnyKgUIpX2XuK7mRXAxCy2Ro3kqCMb1Pjr 0kNPigI1lyLDvwB7QfRDS8SlAhcYXy/RRzwa8Mk7dyJHI2HAcZBEL1EGEguoZx8B9ZAt gu8GfWFIH8wDouAAn6o8vb5u1XrCCxVgTJjfKz4IDm5skcK8+qFOOd0lucdJ5AuZXyjo 7Z/r2o9VB91EAX9vu3PWGad24XJcGiMUt78Zo67tIsJ5OaYpoVESWjp30S1bnbL4v9FD WIPg== X-Gm-Message-State: APjAAAUF01cvdTviQrFTfGWjfSxu4ESsUFYgB03/uW4nFkh5yZulgaSU sj8peHFTNTgPrBQZ9m0dOXHJzc1/LSZ6vjorP5GiUw== X-Received: by 2002:a2e:85d2:: with SMTP id h18mr2032854ljj.18.1569576795305; Fri, 27 Sep 2019 02:33:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Baolin Wang Date: Fri, 27 Sep 2019 17:33:03 +0800 Message-ID: Subject: Re: [PATCH v3 0/3] Add MMC software queue support To: Adrian Hunter Cc: Ulf Hansson , asutoshd@codeaurora.org, Orson Zhai , Chunyan Zhang , Arnd Bergmann , Linus Walleij , Vincent Guittot , linux-mmc , LKML 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 Thu, 26 Sep 2019 at 20:08, Adrian Hunter wrote: > > 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. OK. I will talk with Ulf to think about a good name. Thanks. -- Baolin Wang Best Regards