From patchwork Fri Sep 28 17:45:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10620229 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 9CF7915A7 for ; Fri, 28 Sep 2018 17:45:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A7702BEB6 for ; Fri, 28 Sep 2018 17:45:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D1132BF68; Fri, 28 Sep 2018 17:45:53 +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 5B1222BEB6 for ; Fri, 28 Sep 2018 17:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726121AbeI2AKm (ORCPT ); Fri, 28 Sep 2018 20:10:42 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42826 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbeI2AKm (ORCPT ); Fri, 28 Sep 2018 20:10:42 -0400 Received: by mail-qk1-f196.google.com with SMTP id g20-v6so3240180qke.9 for ; Fri, 28 Sep 2018 10:45:51 -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=DhRGIV9aJq1LIJK2qOL1gEMwvqkSfgjEF4v5S5RzTlE=; b=Pw13qM6DFMheHgNfNoOO74Fa1TL3hzzgV1DCZSqvFh4raFB1vYWuuG3jhx0LBghB9Y ydZRVsbwQsnDog7rN/vnpAjbungKRWn+RHmwPmxj+m5jqFc/ImWjMTb1vrwA8uPa+7Ys lpNdT5uXdWNn07AW6m2IY4/Pmhmepo81cKBFYhDAXVkAVoOQOY3b0a11mCM2rrx0dFFw Umrv9kJh7t1jjxMUT59onlW6gb/t/H5RSrSCgtNPX33Z++zJwFP1YG6C2xCTvHxTbfxB HccYcVZr5MVGtf9zFLT31SwZBh9y9Zdlqkj7pWBRUXIjt56MrSoS/lzATVIBBCC0YqLr Zq8Q== 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=DhRGIV9aJq1LIJK2qOL1gEMwvqkSfgjEF4v5S5RzTlE=; b=NsFiImdKnYuFHNLUinOy7zOWslQVf/H9mc5NSwdhjs1cNg+glAGIXW5v8TKz2L2ndS gI8SURfh+4TvkMPDpkkEJ1b9mD3tb9dmEXOp+agjU5V0Cyv5ZDZj3jvU4DWaXZTQn50O HHAnwKWlSA7bwKW5vT85P9MItRBsjRiyM/PsySP9f1oLoUwiuuO1MC4/r2xztG6wYUZ7 FzYl2u36bBH5By/NeAyKyquP9eRjAboEfnKd4nvIRISaEDBbQJ/GNsVVRM20wIdfqJTS zaYdETZmVVfT9WyLsfSSPjkqUiKPwsroW+bLMKM+D2aHx4XU50MirVZgDKu9Wl0YuNHQ qaAQ== X-Gm-Message-State: ABuFfohunCklqBr0jvT0T0nSNdKt179EVhgR47/U8yHVhneL/qWD50Ca 8h8BmOTCl4S+79ClqFZvd+tJtw== X-Google-Smtp-Source: ACcGV63dkU/707VWCgIHb/XdbLgSY9a2p/yrgXL0x4gY+0RbKpLeAKGaWxbqT/B4zevh5DjTfvJ/tA== X-Received: by 2002:ae9:ea1a:: with SMTP id f26-v6mr12386767qkg.210.1538156750874; Fri, 28 Sep 2018 10:45:50 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id u27-v6sm3311032qki.85.2018.09.28.10.45.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 10:45:50 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 2/5] blk-iolatency: deal with nr_requests == 1 Date: Fri, 28 Sep 2018 13:45:40 -0400 Message-Id: <20180928174543.28486-3-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 Hitting the case where blk_queue_depth() returned 1 uncovered the fact that iolatency doesn't actually handle this case properly, it simply doesn't scale down anybody. For this case we should go straight into applying the time delay, which we weren't doing. Since we already limit the floor at 1 request this if statement is not needed, and this allows us to set our depth to 1 which allows us to apply the delay if needed. 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 c2e38bc12f27..8daea7a4fe49 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -312,7 +312,7 @@ static void scale_change(struct iolatency_grp *iolat, bool up) iolat->rq_depth.max_depth = old; wake_up_all(&iolat->rq_wait.wait); } - } else if (old > 1) { + } else { old >>= 1; iolat->rq_depth.max_depth = max(old, 1UL); }