From patchwork Mon Sep 10 20:49:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10594773 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 67735920 for ; Mon, 10 Sep 2018 20:49:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56AE02933E for ; Mon, 10 Sep 2018 20:49:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B41E29348; Mon, 10 Sep 2018 20:49:42 +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 F404F2933E for ; Mon, 10 Sep 2018 20:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbeIKBpd (ORCPT ); Mon, 10 Sep 2018 21:45:33 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:33007 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbeIKBpd (ORCPT ); Mon, 10 Sep 2018 21:45:33 -0400 Received: by mail-qt0-f195.google.com with SMTP id r37-v6so25905412qtc.0 for ; Mon, 10 Sep 2018 13:49:41 -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=bGm/kb/2sQboIQdXNK6Af8m1JWQFRFqyz4BMP+GYUg8=; b=hAFxPHD67sbRUQdK7l7PNni+/CkdwglJ2uO5vBZAGCcJUoK6sHK5Awy69N82iKQ46D k5yJ0ctR0MThtbvC2MzonY8MnONSyMbezETbfkLbA5P+ncQm/DW+LJxL5YoCgF4OG1S/ 2at+shF9JJ96TNAHFsqeKkcoEoIJw6p5uW7j+wyymIZw5Sckg3s1RxIB8JzNsUO9Jnrn r7Y6YDquxvUlqqgjT56c6s2Hm7AvTP9mKGqn03v2vqUJ65cIBvNAJgnrK/uTsNA9R0OU ir7V/UScJCXRTopPX7kM8iQ4z7ERQsKbvVGOeEbIuz3SbkT+BV0BAulg7sD58UligETw 56Wg== 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=bGm/kb/2sQboIQdXNK6Af8m1JWQFRFqyz4BMP+GYUg8=; b=mQMp+QHB47cWNsQe4Nmm3kXM8G+OAm/cH7tPaR8/7iL/QqJD478sfogF/jX4oamXQP 8D2UF+6VlkQawnckl2A6AfAW830tE3ZVvmtvSDlc+HF0FwEAg0AEWZ+r7SHJWjgt/AjF beomR3XDSCDrl6gPc0G/SKpr+TpVIcSO1/ynd2RoPjSqmvofSwOjAucxx4c11gQhFEp+ 5k2UmcRpphQtRa3xS1oK7XyM0xbYth0T+MfawIprl5/J9lnQy76UotT7A3kl8pYBw31R YJhL22Bkoh84meZUq+A7vG9QZwOMkqP8gbF/o0uDXatdme/uIpMkTc07yUJws0QzD0gP KxBA== X-Gm-Message-State: APzg51BfEzsX4pBKF9HIy1loZeE7t0D7NJgrwNea2xPsE/lZGv/bICYV +ysgbuJ7KlRRUoBhnw/nA1MysbJYQTsZ1A== X-Google-Smtp-Source: ANB0VdZXQZoRkyzR8InwJQ1IuCST/HuxlfzGWATlmo59BavqDfwQiCJygbGKmXVh3ULZ4kOTIfAzkg== X-Received: by 2002:ac8:13c3:: with SMTP id i3-v6mr18023091qtj.54.1536612580635; Mon, 10 Sep 2018 13:49:40 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id k15-v6sm13039398qtf.95.2018.09.10.13.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 13:49:39 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org Subject: [PATCH 3/6] blk-iolatency: deal with nr_requests == 1 Date: Mon, 10 Sep 2018 16:49:29 -0400 Message-Id: <20180910204932.14323-4-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 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 8f32aa1817f8..4ed05d09a69e 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); }