From patchwork Sat Mar 4 16:01:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 9604077 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 68BE060453 for ; Sat, 4 Mar 2017 16:05:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 591A6283CB for ; Sat, 4 Mar 2017 16:05:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AD6B284E7; Sat, 4 Mar 2017 16:05:11 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 B73CF283CB for ; Sat, 4 Mar 2017 16:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbdCDQCo (ORCPT ); Sat, 4 Mar 2017 11:02:44 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36823 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbdCDQCn (ORCPT ); Sat, 4 Mar 2017 11:02:43 -0500 Received: by mail-wm0-f52.google.com with SMTP id n11so35249249wma.1 for ; Sat, 04 Mar 2017 08:02:42 -0800 (PST) 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=gCYIaK5HFX+YWHtJGh752GtEBIs2sliSKUCgtb6FOyE=; b=O5FLkTYzvyQjRsTPHDNcasda02DOeq5nlMZCIa5a2PdaNuSP7qxWMN+axh2yUuXmWQ 1vktxeyynJseYKAmlMOHyjepRdVlWiLNcq83lu9pu0X94jsnwwkTcpgZz673fLX4yDhO fBUPU11Da8VT+10rA0bB542GDJW3RWvL/hrPg= 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=gCYIaK5HFX+YWHtJGh752GtEBIs2sliSKUCgtb6FOyE=; b=fPedL+ae9nH16Y9CC9pKcuwUPEgxBJDUnn8rSnKbo23EJfyhSJZr+nMoX++/1xCmiQ fn3cUlFAjamoYABTt1WV6tCo9myj5d5TKrza54SYk1xPeDY2ErdQ3L85rs3S3PlQ4Ll/ UarhjBDLMcIVXuV03fxCQN1d5uxH4V4S/RPxi7YXMeNgivweN07ZYjCyyhkh5+LzpsuB M5N+Otd2W+QVVigOdqnp+VYmObfQLKayhWIS9/UWuLhgcaqL73aiXKAvXuJy1GXI38VC tBZTGRuw60elrsXLj4xy0LyYrOsY70GaYOp/8FXFpV4QPNy++hOLIAJ0k9eCaY+KK7q6 0gag== X-Gm-Message-State: AMke39naP33tchM01jEy9ft0GSACbKjscIHUSlRvwGyjArhwj7Hy+q98zwc0Q3saMS8NnL0v X-Received: by 10.28.152.212 with SMTP id a203mr7680689wme.7.1488643361288; Sat, 04 Mar 2017 08:02:41 -0800 (PST) Received: from localhost.localdomain ([185.14.10.61]) by smtp.gmail.com with ESMTPSA id g6sm7474035wmc.30.2017.03.04.08.02.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:02:40 -0800 (PST) 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 RFC 13/14] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Date: Sat, 4 Mar 2017 17:01:30 +0100 Message-Id: <20170304160131.57366-14-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170304160131.57366-1-paolo.valente@linaro.org> References: <20170304160131.57366-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 | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index e509237..10d550b 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6372,20 +6372,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, @@ -6393,7 +6388,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, @@ -8301,7 +8297,7 @@ static struct blkcg_policy blkcg_policy_bfq = { static int __init bfq_init(void) { int ret; - char msg[50] = "BFQ I/O-scheduler: v6"; + char msg[50] = "BFQ I/O-scheduler: v7r3"; #ifdef CONFIG_BFQ_GROUP_IOSCHED ret = blkcg_policy_register(&blkcg_policy_bfq);