Received: by 10.192.165.148 with SMTP id m20csp621220imm; Wed, 25 Apr 2018 05:16:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr6KikZjqmYF1mB3G2sTXk2YwF7g1YTl99ky6I8YyZdqcY83BxXvhRJoS7ephTFDqX2mipg X-Received: by 10.98.147.66 with SMTP id b63mr6510025pfe.130.1524658564858; Wed, 25 Apr 2018 05:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658564; cv=none; d=google.com; s=arc-20160816; b=A1otvQJxh93g4Wzs4rkqZeOTIWIdJo1ekPLg9kE5JWw+olFxNrDPu3kHq/6YIKH4qm CGi4Lo5I1OWBoatzoyYtrcp15KXByWWYxcctUZoW6dzJmHeeZF1ILiVuQGcCrQgxjy+0 wgH0bImybqKMmyhvFyPo3Dg9NKodzAziwhU2d8p+hQzlkjnVBoKTmxqginWE2kgis6PL 9HZR8Y7gpFxGoM6cFVsHSwAaPdhM3ZOOa51AN9PPVnezZmnyIaOGF+u6k2ULTofsUm7+ QFvWxThBXqeAb3gLNqBzmySexc/APqoi+hDM2WnvKlmk9TrooTgKufuHnwfGSGMNSUY/ i6MQ== 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:dkim-signature :arc-authentication-results; bh=XSk1v9QydOPULBxmFjVnTx3YvGs/icec+EwOq/WMwFg=; b=U+KwG8ORLZ4SvQNrugd4FrjajiXpC/sYLTdaPNK9zkm5QMWTubYcKclzmmGrpF2b+S mUKOGOMNP+kmqkDVj6GhUgJurv2UEYI49ZmxRKDLGnQ5wkbB3uv2UkrK3jri/U4BoF5t EqopaFoyal45khS7TkAJkHPgbgTDgBTWhIcyRaxWbBVITsX83Hzb7NwacnEKXJ0YNF8e qzypvhKfqma7F5U3y+M70Wd+UW1dFlleFGPkJPuh7GkDOOZTQOq9PmL1dPJxERi8xpK5 YsQ4lNZaOAVSu3UuNJiy3KBNlIJ3EYzjhzQAVhIrY1EA9HhutPf0mER4wgTbSeI1hCbD 9qDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jjrRWX4b; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si12013858pgt.68.2018.04.25.05.15.50; Wed, 25 Apr 2018 05:16:04 -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=@gmail.com header.s=20161025 header.b=jjrRWX4b; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753584AbeDYMOG (ORCPT + 99 others); Wed, 25 Apr 2018 08:14:06 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:45868 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753253AbeDYMOC (ORCPT ); Wed, 25 Apr 2018 08:14:02 -0400 Received: by mail-oi0-f43.google.com with SMTP id b130-v6so1817667oif.12; Wed, 25 Apr 2018 05:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XSk1v9QydOPULBxmFjVnTx3YvGs/icec+EwOq/WMwFg=; b=jjrRWX4bGW5owefUTTwCXY2TqcLDyu3AVoPRDwGMfXWKvPMuZ44JOIsXu5x0FdcWoH 4gBVcQ9MOLvOaHfUUyQKpYHo69YMedYspK5DiCmrJ1M3CdfhMxWZPAQD4XWjnHsc+IjX Oy7UF+RXDGNR5F71Uz6O9T7xoxKwePr4bCXSw+PwltlA5hJCCOKbVlVmxz34rXz18osg r+BFeXoE7d5FWZdn8SSTRe7C+/REYPa20YoTqdIVlxKbow6QaI6nWLYSH1kaKpC79WYI rPQ5OAAAnX5+c+ZlaQpgYGaK5wQSvWf1xm62Jj4ra3oClU9sm03DjrTV/w9ck3sExb8b 6bxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XSk1v9QydOPULBxmFjVnTx3YvGs/icec+EwOq/WMwFg=; b=OVLt0qXjjXNZ3txdxF1PSRqUj2h+ET+XXqDE59kxbanmdmXxvydqi5vjaFXs3NCqr1 Ao7UFtYk6fSWTVGo/awTa+CS5PfizcerL3ghKfUEadcV7LK9GEGfaDMqM2RNe+sHkT4y AekhAaD6U8OJjLlAnV+AVkPEHx2qgaeUbj1Vunbc4o++cbv/NdaNQ2DeGfwee0iXCzfg eGpP98lCr13WDLEO4ZS58GUhGsBLdgyTLnCrHZeiXc7b88jaq8gr6iW9ncXyXxjpeUgG 3KFrs/DhvGMYs0MOCXtYst5RmNbMGUPPJy9Ico9e1XbczB2a97MvKhYNdcUU3H/vZrMp 0s1g== X-Gm-Message-State: ALQs6tAGRGMJrLfcJThcbMIyFUBF2l/b9R/7dwKWRblkSuGX7RoEX3pg YVljpZvqs15FNLjWHTzr9JGxiAHO X-Received: by 2002:aca:5b05:: with SMTP id p5-v6mr18459257oib.122.1524658441579; Wed, 25 Apr 2018 05:14:01 -0700 (PDT) Received: from JosephdeMacBook-Pro.local ([205.204.117.20]) by smtp.gmail.com with ESMTPSA id d69-v6sm10266650oih.58.2018.04.25.05.13.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 05:14:00 -0700 (PDT) Subject: Re: testing io.low limit for blk-throttle To: Paolo Valente Cc: linux-block , Jens Axboe , Shaohua Li , Mark Brown , Linus Walleij , Ulf Hansson , LKML , Tejun Heo References: <4c6b86d9-1668-43c3-c159-e6e23ffb04b4@gmail.com> <18accc1e-c7b3-86a7-091b-1d4b631fcd4a@gmail.com> <536A1B1D-575F-4193-ADA6-BA832AEC7179@linaro.org> From: Joseph Qi Message-ID: <871b8d16-a172-af68-1aae-92ae55c0cce7@gmail.com> Date: Wed, 25 Apr 2018 20:13:51 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <536A1B1D-575F-4193-ADA6-BA832AEC7179@linaro.org> 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 Hi Paolo, On 18/4/24 20:12, Paolo Valente wrote: > > >> Il giorno 23 apr 2018, alle ore 11:01, Joseph Qi ha scritto: >> >> >> >> On 18/4/23 15:35, Paolo Valente wrote: >>> >>> >>>> Il giorno 23 apr 2018, alle ore 08:05, Joseph Qi ha scritto: >>>> >>>> Hi Paolo, >>> >>> Hi Joseph, >>> thanks for chiming in. >>> >>>> What's your idle and latency config? >>> >>> I didn't set them at all, as the only (explicit) requirement in my >>> basic test is that one of the group is guaranteed a minimum bps. >>> >>> >>>> IMO, io.low will allow others run more bandwidth if cgroup's average >>>> idle time is high or latency is low. >>> >>> What you say here makes me think that I simply misunderstood the >>> purpose of io.low. So, here is my problem/question: "I only need to >>> guarantee at least a minimum bandwidth, in bps, to a group. Is the >>> io.low limit the way to go?" >>> >>> I know that I can use just io.max (unless I misunderstood the goal of >>> io.max too :( ), but my extra purpose would be to not waste bandwidth >>> when some group is idle. Yet, as for now, io.low is not working even >>> for the first, simpler goal, i.e., guaranteeing a minimum bandwidth to >>> one group when all groups are active. >>> >>> Am I getting something wrong? >>> >>> Otherwise, if there are some special values for idle and latency >>> parameters that would make throttle work for my test, I'll be of >>> course happy to try them. >>> >> I think you can try idle time with 1000us for all cgroups, and latency >> target 100us for cgroup with low limit 100MB/s and 2000us for cgroups >> with low limit 10MB/s. That means cgroup with low latency target will >> be preferred. >> BTW, from my expeierence the parameters are not easy to set because >> they are strongly correlated to the cgroup IO behavior. >> > > +Tejun (I guess he might be interested in the results below) > > Hi Joseph, > thanks for chiming in. Your suggestion did work! > > At first, I thought I had also understood the use of latency from the > outcome of your suggestion: "want low limit really guaranteed for a > group? set target latency to a low value for it." But then, as a > crosscheck, I repeated the same exact test, but reversing target > latencies: I gave 2000 to the interfered (the group with 100MB/s > limit) and 100 to the interferers. And the interfered still got more > than 100MB/s! So I exaggerated: 20000 to the interfered. > Same outcome :( > > I tried really many other combinations, to try to figure this out, but > results seemed more or less random w.r.t. to latency values. I > didn't even start to test different values for idle. > > So, the only sound lesson that I seem to have learned is: if I want > low limits to be enforced, I have to set target latency and idle > explicitly. The actual values of latencies matter little, or not at > all. At least this holds for my simple tests. > > At any rate, thanks to your help, Joseph, I could move to the most > interesting part for me: how effective is blk-throttle with low > limits? I could well be wrong again, but my results do not seem that > good. With the simplest type of non-toy example I considered, I > recorded throughput losses, apparently caused mainly by blk-throttle, > and ranging from 64% to 75%. > > Here is a worst-case example. For each step, I'm reporting below the > command by which you can reproduce that step with the > thr-lat-with-interference benchmark of the S suite [1]. I just split > bandwidth equally among five groups, on my SSD. The device showed a > peak rate of ~515MB/s in this test, so I set rpbs to 100MB/s for each > group (and tried various values, and combinations of values, for the > target latency, without any effect on the results). To begin, I made > every group do sequential reads. Everything worked perfectly fine. > > But then I made one group do random I/O [2], and troubles began. Even > if the group doing random I/O was given a target latency of 100usec > (or lower), while the other had a target latency of 2000usec, the poor > random-I/O group got only 4.7 MB/s! (A single process doing 4k sync > random I/O reaches 25MB/s on my SSD.) > > I guess things broke because low limits did not comply any longer with > the lower speed that device reached with the new, mixed workload: the > device reached 376MB/s, while the sum of the low limits was 500MB/s. > BTW the 'fault' for this loss of throughput was not only of the device > and the workload: if I switched throttling off, then the device still > reached its peak rate, although granting only 1.3MB/s to the > random-I/O group. > > So, to comply with the 376MB/s, I lowered the low limits to 74MB/s per > group (to avoid a too tight 75MB/s) [3]. A little better: the > random-I/O group got 7.2 MB/s. But the total throughput went down > further, to 289MB/s, and became again lower than the sum of the low > limits. Most certainly, this time the throughput went down mainly > because blk-throttling was serving the random I/O more than before. > > To make a long story short, I arrived to setting just 12MB/s as low > limit for each group [4]. The random-I/O group was finally happy, > with a revitalizing 12.77MB/s. But the total throughput dropped down > to 127MB/s, i.e., ~25% of the peak rate of the device. Now the > 'fault' for the throughput loss seemed undoubtedly of blk-throttle. > The latter was evidently over-throttling some group. > > To sum up, for my device, 12MB/s seems to be the highest value for > which low limits can be guaranteed. But setting these limits entails > a high cost: if just one group really does random I/O, then 75% of the > throughput is lost. > > There would be other issues too. For example, 12MB/s might be too > little for the needs of some group in some time period. This fact would > make it extremely difficult, if ever possible, to set low limits that > comply with the needs of more dynamic (and probably more > realistic) workloads than the above one. > Could you run blktrace as well when testing your case? There are several throtl traces to help analyze whether it is caused by frequently upgrade/downgrade. If all cgroups are just running under low, I'am afraid the case you tested has something to do with how SSD handle mixed workload IOs. Thanks, Joseph > I think this is all, sorry for the long mail, I tried to shrink it as > much as possible. Looking forward to some feedback. > > Thanks, > Paolo > > [1] https://github.com/Algodev-github/S > [2] sudo ./thr-lat-with-interference.sh -b t -n 4 -w 100M -W 100M -t randread -L 2000 > [3] sudo ./thr-lat-with-interference.sh -b t -n 4 -w 74M -W 74M -t randread -L 2000 > [4] sudo ./thr-lat-with-interference.sh -b t -n 4 -w 12M -W 12M -t randread -L 2000 >