From patchwork Fri Mar 31 12:47:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 9656255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 208AC60349 for ; Fri, 31 Mar 2017 12:51:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12AB228688 for ; Fri, 31 Mar 2017 12:51:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0791328691; Fri, 31 Mar 2017 12:51:15 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 AEB6928688 for ; Fri, 31 Mar 2017 12:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933366AbdCaMuB (ORCPT ); Fri, 31 Mar 2017 08:50:01 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:36112 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933387AbdCaMs7 (ORCPT ); Fri, 31 Mar 2017 08:48:59 -0400 Received: by mail-wr0-f177.google.com with SMTP id w11so103679337wrc.3 for ; Fri, 31 Mar 2017 05:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yMuzKEPldPl0lP+MMtm9PIV7y65CZFddtuXh3P/bTEw=; b=DN7XnNgqW6z4unPU7mgk4lOcJNYlFyF/flCRpc3EIdQNUgjHTl1qODK7BXyVsIIqiO bI2LCEMQitkBFDTw4hO1j+L8adV7ZDILC1iwzLdZ6nfWubXM4DFRt6MXhF1UJBabKvBt /rKt4NDA/9Q3sQZiTFD98wZSsPsX2tXIG47sk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yMuzKEPldPl0lP+MMtm9PIV7y65CZFddtuXh3P/bTEw=; b=VnmmXD9BqA7azVz4/t5xt9cjA7EwnVgHWIL9p4ADMmTEd735V3M4HZZUcAJOxc1nRS fvudyXwWG/yMub0MyQNyJ0KEziDJG6dyNBfwQJGaKAgMWtSepUkTgVFrRkQl0Qg5KDg7 h3tERA+aKlnFU4x7IxHyU71KHdfWv47tUbLyitaXAEr+pL/j7hGh0AmAc3sZxSwh46xz xCfUvdykcePPRod8l6uk45YiJWozkDiMAOKh0rzR13+i3Gkx2TlKIRTkBhCiCLfFy+Km GQ6LYL78VxZP/P7hJEj5Yvb1ReUVBgB/HXMfM5Jho/ifK+0h3muw5+KSifh9jPIps49j Hflw== X-Gm-Message-State: AFeK/H0ShOokbC+3xLNTou/i/ZeAreUxtMtjwX/QYHqGEI26gYlh2vp5YdV5G7SDF4ZMT8dd X-Received: by 10.28.88.2 with SMTP id m2mr3259868wmb.12.1490964537812; Fri, 31 Mar 2017 05:48:57 -0700 (PDT) Received: from localhost.localdomain ([185.14.11.71]) by smtp.gmail.com with ESMTPSA id 189sm2793679wmm.31.2017.03.31.05.48.55 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 31 Mar 2017 05:48:56 -0700 (PDT) From: Paolo Valente To: Jens Axboe , Tejun Heo Cc: Fabio Checconi , Arianna Avanzini , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, Paolo Valente Subject: [PATCH V2 13/16] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Date: Fri, 31 Mar 2017 14:47:40 +0200 Message-Id: <20170331124743.3530-14-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170331124743.3530-1-paolo.valente@linaro.org> References: <20170331124743.3530-1-paolo.valente@linaro.org> 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 This patch is basically the counterpart, for NCQ-capable rotational devices, of the previous patch. Exactly as the previous patch does on flash-based devices and for any workload, this patch disables device idling on rotational devices, but only for random I/O. In fact, only with these queues disabling idling boosts the throughput on NCQ-capable rotational devices. To not break service guarantees, idling is disabled for NCQ-enabled rotational devices only when the same symmetry conditions considered in the previous patches hold. Signed-off-by: Paolo Valente Signed-off-by: Arianna Avanzini --- block/bfq-iosched.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index ca1ae24..738fd5f 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6423,20 +6423,15 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) * The next variable takes into account the cases where idling * boosts the throughput. * - * The value of the variable is computed considering that - * idling is usually beneficial for the throughput if: + * The value of the variable is computed considering, first, that + * idling is virtually always beneficial for the throughput if: * (a) the device is not NCQ-capable, or * (b) regardless of the presence of NCQ, the device is rotational - * and the request pattern for bfqq is I/O-bound (possible - * throughput losses caused by granting idling to seeky queues - * are mitigated by the fact that, in all scenarios where - * boosting throughput is the best thing to do, i.e., in all - * symmetric scenarios, only a minimal idle time is allowed to - * seeky queues). + * and the request pattern for bfqq is I/O-bound and sequential. * * Secondly, and in contrast to the above item (b), idling an * NCQ-capable flash-based device would not boost the - * throughput even with intense I/O; rather it would lower + * throughput even with sequential I/O; rather it would lower * the throughput in proportion to how fast the device * is. Accordingly, the next variable is true if any of the * above conditions (a) and (b) is true, and, in particular, @@ -6444,7 +6439,8 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) * device. */ idling_boosts_thr = !bfqd->hw_tag || - (!blk_queue_nonrot(bfqd->queue) && bfq_bfqq_IO_bound(bfqq)); + (!blk_queue_nonrot(bfqd->queue) && bfq_bfqq_IO_bound(bfqq) && + bfq_bfqq_idle_window(bfqq)); /* * The value of the next variable,