Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp627788ybm; Tue, 21 May 2019 00:21:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVFRt6w8VpsTzygKatsqmFLel5YWsTO2Hyxsa6tGBgGvlotVbcnIDHPx+T0G6oyTOvdHHt X-Received: by 2002:a65:64d5:: with SMTP id t21mr6380486pgv.310.1558423289183; Tue, 21 May 2019 00:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558423289; cv=none; d=google.com; s=arc-20160816; b=OfijpGvWFFvvSTO2eKdlx4CfRHhPHTPbyzkDSWFspAWnkxUBxJnCd4/G+b9xq4dsyt WGUHeCCOvA0Hjh0C52qyFHi+Ke4xDvbOtn/34DzixcDCgzOtZW2rHlm4OAPN+IErVvW6 fUvmP2AA3FnwbYC5evrcmTx7NiW6X2vXIIp94wTw+yJmnZkFt5Q4NVcoPz1MSm+sdUxO nQxzFZ9zQPDyATRVPLXodSlgDWsdtlP6u2JEtz5mM9J9ueq8H+IjuDVUrzMZ3rTF8izf kkG6/K4/EXAAl3tmHnbNKQptGYG7LvKGoCMxIs94ckWCza2j9r09g70N4wOPutvKNWnP 2YdQ== 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:from:references:cc:to:subject; bh=FxRs6scnRAsfQ8r2+IMYUrOfWgh9IigDHpHiE5YHhbI=; b=LuHA/XIAiAx4aveoFsQ9ZNTSoH4pXRMPmfx2G3JJXESnDRiT2N8pptOWh1COHee3II jsNg5BMdWIAoGXSL71GfWBKqH323XSnVe1bFlCteOdYr9ErBYRITCPJUfrvZjrqVPbad Mj0u4NUwK8Pycuo/CICTNUdVo2kuvul9PeR/hytwSWsSbVHUojeAPlj2VKxtqjoZt0LW RwGUjsw6clUXJ6ux6CEwY1yyPm2kgGhBau+ELTRrWOC/tAO3VIFyjjDdokoWGbF6w6EL 4/lTDmeW5K55lVvBpwGPcec/qgphNHgOmwEhripaA+F2ZzDNf3pGzYZZgvjR/V3eSr9U Ie3Q== 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=csail.mit.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si21197842plz.168.2019.05.21.00.21.14; Tue, 21 May 2019 00:21:29 -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=csail.mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbfEUHTq (ORCPT + 99 others); Tue, 21 May 2019 03:19:46 -0400 Received: from outgoing-stata.csail.mit.edu ([128.30.2.210]:57311 "EHLO outgoing-stata.csail.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbfEUHTq (ORCPT ); Tue, 21 May 2019 03:19:46 -0400 Received: from c-73-193-85-113.hsd1.wa.comcast.net ([73.193.85.113] helo=srivatsab-a01.vmware.com) by outgoing-stata.csail.mit.edu with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1hSz3h-000Bpw-PS; Tue, 21 May 2019 03:19:37 -0400 Subject: Re: CFQ idling kills I/O performance on ext4 with blkio cgroup controller To: Paolo Valente Cc: linux-fsdevel@vger.kernel.org, linux-block , linux-ext4@vger.kernel.org, cgroups@vger.kernel.org, kernel list , Jens Axboe , Jan Kara , jmoyer@redhat.com, Theodore Ts'o , amakhalov@vmware.com, anishs@vmware.com, srivatsab@vmware.com References: <8d72fcf7-bbb4-2965-1a06-e9fc177a8938@csail.mit.edu> <1812E450-14EF-4D5A-8F31-668499E13652@linaro.org> <46c6a4be-f567-3621-2e16-0e341762b828@csail.mit.edu> <07D11833-8285-49C2-943D-E4C1D23E8859@linaro.org> <238e14ff-68d1-3b21-a291-28de4f2d77af@csail.mit.edu> <6EB6C9D2-E774-48FA-AC95-BC98D97645D0@linaro.org> From: "Srivatsa S. Bhat" Message-ID: Date: Tue, 21 May 2019 00:19:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6EB6C9D2-E774-48FA-AC95-BC98D97645D0@linaro.org> Content-Type: text/plain; charset=windows-1252 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 5/20/19 11:23 PM, Paolo Valente wrote: > > >> Il giorno 21 mag 2019, alle ore 00:45, Srivatsa S. Bhat ha scritto: >> >> On 5/20/19 3:19 AM, Paolo Valente wrote: >>> >>> >>>> Il giorno 18 mag 2019, alle ore 22:50, Srivatsa S. Bhat ha scritto: >>>> >>>> On 5/18/19 11:39 AM, Paolo Valente wrote: >>>>> I've addressed these issues in my last batch of improvements for BFQ, >>>>> which landed in the upcoming 5.2. If you give it a try, and still see >>>>> the problem, then I'll be glad to reproduce it, and hopefully fix it >>>>> for you. >>>>> >>>> >>>> Hi Paolo, >>>> >>>> Thank you for looking into this! >>>> >>>> I just tried current mainline at commit 72cf0b07, but unfortunately >>>> didn't see any improvement: >>>> >>>> dd if=/dev/zero of=/root/test.img bs=512 count=10000 oflag=dsync >>>> >>>> With mq-deadline, I get: >>>> >>>> 5120000 bytes (5.1 MB, 4.9 MiB) copied, 3.90981 s, 1.3 MB/s >>>> >>>> With bfq, I get: >>>> 5120000 bytes (5.1 MB, 4.9 MiB) copied, 84.8216 s, 60.4 kB/s >>>> >>> >>> Hi Srivatsa, >>> thanks for reproducing this on mainline. I seem to have reproduced a >>> bonsai-tree version of this issue. Before digging into the block >>> trace, I'd like to ask you for some feedback. >>> >>> First, in my test, the total throughput of the disk happens to be >>> about 20 times as high as that enjoyed by dd, regardless of the I/O >>> scheduler. I guess this massive overhead is normal with dsync, but >>> I'd like know whether it is about the same on your side. This will >>> help me understand whether I'll actually be analyzing about the same >>> problem as yours. >>> >> >> Do you mean to say the throughput obtained by dd'ing directly to the >> block device (bypassing the filesystem)? > > No no, I mean simply what follows. > > 1) in one terminal: > [root@localhost tmp]# dd if=/dev/zero of=/root/test.img bs=512 count=10000 oflag=dsync > 10000+0 record dentro > 10000+0 record fuori > 5120000 bytes (5,1 MB, 4,9 MiB) copied, 14,6892 s, 349 kB/s > > 2) In a second terminal, while the dd is in progress in the first > terminal: > $ iostat -tmd /dev/sda 3 > Linux 5.1.0+ (localhost.localdomain) 20/05/2019 _x86_64_ (2 CPU) > > ... > 20/05/2019 11:40:17 > Device tps MB_read/s MB_wrtn/s MB_read MB_wrtn > sda 2288,00 0,00 9,77 0 29 > > 20/05/2019 11:40:20 > Device tps MB_read/s MB_wrtn/s MB_read MB_wrtn > sda 2325,33 0,00 9,93 0 29 > > 20/05/2019 11:40:23 > Device tps MB_read/s MB_wrtn/s MB_read MB_wrtn > sda 2351,33 0,00 10,05 0 30 > ... > > As you can see, the overall throughput (~10 MB/s) is more than 20 > times as high as the dd throughput (~350 KB/s). But the dd is the > only source of I/O. > > Do you also see such a huge difference? > Ah, I see what you mean. Yes, I get a huge difference as well: I/O scheduler dd throughput Total throughput (via iostat) ------------- ------------- ----------------------------- mq-deadline or 1.6 MB/s 50 MB/s (30x) kyber bfq 60 KB/s 1 MB/s (16x) Regards, Srivatsa VMware Photon OS