Received: by 10.192.165.148 with SMTP id m20csp306648imm; Thu, 26 Apr 2018 22:15:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHIHiKkQfnACfWTTJz9kYEULjW183qJHXawav8g3lnsGuducF5lZVge2szGQ1KuwUPjegP X-Received: by 10.98.159.202 with SMTP id v71mr866343pfk.233.1524806147676; Thu, 26 Apr 2018 22:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524806147; cv=none; d=google.com; s=arc-20160816; b=xEGf5HJ+Ms44klMRu+JiqxjJfHupIb5kkMx0cKH0VsbYSqVskgR7G8F+Gr+kdwj+Pk aABtD+3hC1yDzfhT1csSPu1/VdphlN8YnclWXeeEDQpe34ttKWPJY3jGBclDLEHf8l12 9PzWeqIUFucBH+o8xW2XrL9+Tf4dnP5mYyVI1lHZROcAnW6S1L6IAmu/8ufMFBHxHB3e RFLCPGJfXGZFxaiKbbFVDEi+TT7c5dxtRKU3Msm/7NKEwY0HdtNam8BzZWPIxRqtAOdW cAodwkLQLOe7Ps0+r1xQ+EYSCiP4C1K0X0IPb67ATCNm2e1eEA8TrBMaoDRkPvRpDpF8 ly8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=OyfYw07q0kp+FvkteCo5fVY17SqMhOlEjWCdDXYMS2Y=; b=R9Bb+Lgi0mz6zI8EZWyOCqIlC7/SchbweOZN+aLhYHddwcpFj1YpT9h2MEx1phDiDY p+RKS6oJXhERSJfc8lBdf41wiuBwaqVdK9BAo7yYc03Br1Xs00W15cCKIJn3S8BuT28t fm25H1MVQbOjBwfaeTs3pGoG+WEjnoRL4zeqPc+GCMmUd0HDCi6TM0kil/xMu+XwxW3j vWOtA6E28Zy26baZgS9j/ciw6ubaCQLxe9Lp8NdNZctWJjGhcHl0KRKqeMaFuxx3gXPo e2u0bjr6dqmeR6f5BsYri1JPRX0giSJT2x3K1ysprtxP/6xh+seozDpzVAEa0t9PEJpn 6Fsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e/Kp1Lm2; 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 p5-v6si509736plk.537.2018.04.26.22.15.32; Thu, 26 Apr 2018 22:15:47 -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=e/Kp1Lm2; 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 S1751753AbeD0FOZ (ORCPT + 99 others); Fri, 27 Apr 2018 01:14:25 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:45824 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeD0FOX (ORCPT ); Fri, 27 Apr 2018 01:14:23 -0400 Received: by mail-wr0-f172.google.com with SMTP id p5-v6so471695wre.12 for ; Thu, 26 Apr 2018 22:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OyfYw07q0kp+FvkteCo5fVY17SqMhOlEjWCdDXYMS2Y=; b=e/Kp1Lm2H11b27e+uTuOB/uxu6jNaXGbOImkoeHFQqDU0kCObFdrCRSIoRv0npR/78 hyWu1ke0LPj1scDl9bfXmVmCup0Mko6banlY6imG8ejAihKMbc1NtEEJb4+ObxWXSqFc Gq0gL5pgR9pzWTTY/dX26pNbzCX1GPlxOAZXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OyfYw07q0kp+FvkteCo5fVY17SqMhOlEjWCdDXYMS2Y=; b=XDOVZAVjBr9ry+g85MPQksEcPd5jojlB3J3K/Sohn+FO2s5vlYrbuey7H0Y5jPhaCu hFcx3hG2pMzGf/noW3kFlZaAFcrjO0PUOh7Q50l1Xg3DdzebX7BJZ7W/N7FcmwkzbJHq 4QMgP1ZdtlJjtx7f7cYrx2fItSh0VvimdYTLdsS85bGuq6M4thYoOHoOiY5uCPWX46TG 3ThEbFzYi6OEJYNo9HegW20QF1CwDu6sHwpVImq9t1g10kCjmI9Pl+mr603xVNKDlMfI xhmKBa5wc69W6DMBFvdboQMZdXq7TjPhxyky2YEr4B7esqW7ctLsW6dvyCRRpI2QRohj JlFA== X-Gm-Message-State: ALQs6tCv0PRmwjsA4iriM0QVHgRfrH5VPP5mlGTsVpZw6Z11NRgJXIEO qZkXcoonjpcL0atvhRSNvTtRBg== X-Received: by 2002:adf:c6c7:: with SMTP id c7-v6mr498085wrh.104.1524806062092; Thu, 26 Apr 2018 22:14:22 -0700 (PDT) Received: from [192.168.0.102] (146-241-56-177.dyn.eolo.it. [146.241.56.177]) by smtp.gmail.com with ESMTPSA id n23-v6sm405763wra.39.2018.04.26.22.14.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 22:14:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: testing io.low limit for blk-throttle From: Paolo Valente In-Reply-To: Date: Fri, 27 Apr 2018 07:14:16 +0200 Cc: linux-block , Jens Axboe , Shaohua Li , Mark Brown , Linus Walleij , Ulf Hansson , LKML , Tejun Heo , 'Paolo Valente' via bfq-iosched Content-Transfer-Encoding: quoted-printable Message-Id: <6D0FF312-8A23-425F-B2D7-9F220887FB31@linaro.org> References: <4c6b86d9-1668-43c3-c159-e6e23ffb04b4@gmail.com> <18accc1e-c7b3-86a7-091b-1d4b631fcd4a@gmail.com> <536A1B1D-575F-4193-ADA6-BA832AEC7179@linaro.org> <871b8d16-a172-af68-1aae-92ae55c0cce7@gmail.com> <5FEFF82B-4160-4F00-A60A-D3A6D9DDE66C@linaro.org> To: Joseph Qi X-Mailer: Apple Mail (2.3445.6.18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Il giorno 27 apr 2018, alle ore 05:27, Joseph Qi = ha scritto: >=20 > Hi Paolo, >=20 > On 18/4/27 01:27, Paolo Valente wrote: >>=20 >>=20 >>> Il giorno 25 apr 2018, alle ore 14:13, Joseph Qi = ha scritto: >>>=20 >>> Hi Paolo, >>>=20 >>=20 >> Hi Joseph >>=20 >>> ... >>> 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. >>=20 >> Certainly. You can find a trace attached. Unfortunately, I'm not >> familiar with the internals of blk-throttle and low limit, so, if you >> want me to analyze the trace, give me some hints on what I have to >> look for. Otherwise, I'll be happy to learn from your analysis. >>=20 >=20 > I've taken a glance at your blktrace attached. It is only upgrade at = first and > then downgrade (just adjust limit, not to LIMIT_LOW) frequently. > But I don't know why it always thinks throttle group is not idle. >=20 > For example: > fio-2336 [004] d... 428.458249: 8,16 m N throtl avg_idle=3D90, = idle_threshold=3D1000, bad_bio=3D10, total_bio=3D84, is_idle=3D0, = scale=3D9 > fio-2336 [004] d... 428.458251: 8,16 m N throtl downgrade, = scale 4 >=20 > In throtl_tg_is_idle(): > is_idle =3D ... || > (tg->latency_target && tg->bio_cnt && > tg->bad_bio_cnt * 5 < tg->bio_cnt); >=20 > It should be idle and allow run more bandwidth. But here the result = shows not > idle (is_idle=3D0). I have to do more investigation to figure it out = why.=20 >=20 Hi Joseph, actually this doesn't surprise me much, for this scenario I expected exactly that blk-throttle would have considered the random-I/O group, for most of the time, 1) non idle, 2) above the 100usec target latency, and 3) below low limit, In fact, 1) The group can evidently issue I/O at a much higher rate than that received, so, immediately after its last pending I/O has been served, the group issues new I/O; in the end, it is is non idle most of the time 2) To try to enforce the 10MB/s limit, blk-throttle necessarily makes the group oscillate around 10MB/s, which means that the group is frequently below limit (this would not have held only if the group had actually received much more than 10MB/s, but it is not so) 3) For each of the 4k random I/Os of the group, the time needed by the drive to serve that I/O is already around 40-50usec. So, since the group is of course not constantly in service, it is very easy that, because of throttling, the latency of most I/Os of the group goes beyond 100usec. But, as it is often the case for me, I might have simply misunderstood blk-throttle parameters, and I might be just wrong here. Thanks, Paolo > You can also filter these logs using: > grep throtl trace | grep -E 'upgrade|downgrade|is_idle' >=20 > Thanks, > Joseph