From patchwork Fri Sep 28 17:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10620231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 914F315E8 for ; Fri, 28 Sep 2018 17:45:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C4C32BEB6 for ; Fri, 28 Sep 2018 17:45:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 703192BF68; Fri, 28 Sep 2018 17:45:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21CB92BEB6 for ; Fri, 28 Sep 2018 17:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbeI2AKo (ORCPT ); Fri, 28 Sep 2018 20:10:44 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40453 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeI2AKo (ORCPT ); Fri, 28 Sep 2018 20:10:44 -0400 Received: by mail-qt1-f193.google.com with SMTP id e9-v6so7524565qtp.7 for ; Fri, 28 Sep 2018 10:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=oPNeefOLqPC1KcU6yOYEg0y5A14BM6tWfLCKEuI6ZJg=; b=wCNBpCm5d1LsbNp/+U3m+ga0x+4n6xIMmBCrz9MxlPt+kpBcC6Tu4ft8Yw/oy2uHB8 Jr+4RYWOES/J5O/F/iTAILHi2f2m3Mvj/Hm6TYh3GLDSIxiceYZ62wASZF0/EZ33xZju Py1M7MVTY8fLbHNjwY/eUY0aSNpULfyxyurKcpEYKEGBm2FzZ/YRaC7Nq5tKOfPiw36S XbgjDDg3U+pzyP/7Ew67KB8jslkSo7l0FEgQ23OM85yeAS4Fa8leGAFooll3JuoZtE1E s3UmI/XRHr0R8qFc0SP8czebdd4/3jU6VguyeN+j2Ek436fdYdQnwMg6sruI9IhZkmVT hYQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=oPNeefOLqPC1KcU6yOYEg0y5A14BM6tWfLCKEuI6ZJg=; b=rO5jfpc9a+KGifErF+E2PWIoxr/tLoCLAjrvarCnFVYBsDUWZ6jg3PKJd5XHX5IU9S aUCwCYlwvySBP7b9JlRjxFZLNhdrwSZgKHLZv6TkGT5CJsynn5RwNiX23F/jF1n7ccmi XHJ25grG1J+zAjiDOx2GkT4KQAcMybLqN4Ub6EcT3kOCwwTcl9raPGnj4Xqlth9R+8yM 6EkeRY9MzuuYANMnnBJaqDvfyZOtPE/gWppM4RPO5BpketSolgkYUh3msAmqxrpeRjkG 1LjxDSrTcm5rBWt9Gk90aTRq/YFlop/RGKG0yf6zim2znncJhKuxvYtpLhLE1As1eyyU M2og== X-Gm-Message-State: ABuFfogkG6pbbztQt/Ttf9HDY3ftKcheeiw7KucVovI+iC9MZ9cojXf+ 2ACo1ktUJwvq+lmOwFvlnNMA4A== X-Google-Smtp-Source: ACcGV60GT8LI6WzlmBZuoY8YsmgU+paTizTOEyfG1V57k31PYw3GjOxbtgZSw/mQ9BdprSaTXIKs4Q== X-Received: by 2002:aed:2867:: with SMTP id r94-v6mr7157031qtd.112.1538156752613; Fri, 28 Sep 2018 10:45:52 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id v12-v6sm3231883qtg.82.2018.09.28.10.45.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 10:45:51 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 3/5] blk-iolatency: deal with small samples Date: Fri, 28 Sep 2018 13:45:41 -0400 Message-Id: <20180928174543.28486-4-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180928174543.28486-1-josef@toxicpanda.com> References: <20180928174543.28486-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is logic to keep cgroups that haven't done a lot of IO in the most recent scale window from being punished for over-active higher priority groups. However for things like ssd's where the windows are pretty short we'll end up with small numbers of samples, so 5% of samples will come out to 0 if there aren't enough. Make the floor 1 sample to keep us from improperly bailing out of scaling down. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 8daea7a4fe49..e7be77b0ce8b 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -366,7 +366,7 @@ static void check_scale_change(struct iolatency_grp *iolat) * scale down event. */ samples_thresh = lat_info->nr_samples * 5; - samples_thresh = div64_u64(samples_thresh, 100); + samples_thresh = max(1ULL, div64_u64(samples_thresh, 100)); if (iolat->nr_samples <= samples_thresh) return; }