From patchwork Mon Sep 10 20:49:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10594775 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 891C113B8 for ; Mon, 10 Sep 2018 20:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 785BC2933C for ; Mon, 10 Sep 2018 20:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CF3D2933F; Mon, 10 Sep 2018 20:49:44 +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 1EBA72933C for ; Mon, 10 Sep 2018 20:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbeIKBpf (ORCPT ); Mon, 10 Sep 2018 21:45:35 -0400 Received: from mail-qk1-f174.google.com ([209.85.222.174]:43675 "EHLO mail-qk1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbeIKBpf (ORCPT ); Mon, 10 Sep 2018 21:45:35 -0400 Received: by mail-qk1-f174.google.com with SMTP id 130-v6so15364049qkd.10 for ; Mon, 10 Sep 2018 13:49:42 -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=Uf4CTQmf00QlbJ2l5r3kflmxEntcHqk8KbXKgTr9kiw=; b=AY+P6Kz3ca4oiC2qtCUMuAryU3TDYKrd4KyJkKBH3UqiaO8aSv7hnUMU8aYyb3BhGY P1+apB5ppdjlur8CkRFHksVfetAVlTf8kwdRCgNhahPo8jdkHWGa9wcuhj+TaleoQo78 ro7m7s4KGKBLm1PVtDLMgg+Kxqe1UcolJEhbXjr5v5STmSjrdQyKeUDklTz008wc21Y3 VaiAwzeL9YhUtNVXhxzNq64V5C556QzTNl4PGRzK0UkNI1n0GpbO2ZRvU1vR7tsvZFjI twx9GcMtUpsXSTQyTcXDQJyAjdaopNXIHPIog8z/YL8y0bpluhBNsCqnz3zqLTJUBLje c3HQ== 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=Uf4CTQmf00QlbJ2l5r3kflmxEntcHqk8KbXKgTr9kiw=; b=QV+RNKniwyp3rFiv1mZYcj/1iByf5QHFP4RqchTdYpxOpAVQWEqi+lErfPQHdKy05w DEkoTykBnAQdqb/NC0kvOSAWxcKIryde9xQQ5C/5dUAbnV92hDVnlUprrthVUy925iF+ Iw4eFUUvbTigyjrIJUqff8D3+K6rDGtSYY1daUly4mscv4lYabedk7idEEyuGs/Jrawh DTBBkzTdeCuT05TK0hNFsDo4gydSl4/hn8fA8Sjzrx3AMveZzvDl3cXHvxkm9w0FLWcR PlkWjYkKyTZJgfWO8rhu3KwGm5pEEVm5ZJFxiQICS/KPMcX2C3gWAjJS480UL/tWTI1X yuHw== X-Gm-Message-State: APzg51BJ/NQkiKZDErKZ+Hnjg/e+3ZzsK9bCq32+b6ZB1aLB122u+VBV 1Yu8Smga6GvehDMOTLTCaWqIvlfon+fD8g== X-Google-Smtp-Source: ANB0VdbSc4GL90Dfx1EpS46moAr39X99cFEblKkhk2dAj3ZecqbKvtB8dL+7pSAo0tT0peaIYAGeZQ== X-Received: by 2002:a37:c993:: with SMTP id m19-v6mr689613qkl.248.1536612582395; Mon, 10 Sep 2018 13:49:42 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id i125-v6sm9462979qke.36.2018.09.10.13.49.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 13:49:41 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org Subject: [PATCH 4/6] blk-iolatency: deal with small samples Date: Mon, 10 Sep 2018 16:49:30 -0400 Message-Id: <20180910204932.14323-5-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180910204932.14323-1-josef@toxicpanda.com> References: <20180910204932.14323-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 4ed05d09a69e..ca545991df83 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; }