From patchwork Tue Apr 11 13:43:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 9675351 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 ED91460381 for ; Tue, 11 Apr 2017 13:45:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E24BB284DA for ; Tue, 11 Apr 2017 13:45:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5C2628565; Tue, 11 Apr 2017 13:45:50 +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 7DA7F284DA for ; Tue, 11 Apr 2017 13:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753826AbdDKNoz (ORCPT ); Tue, 11 Apr 2017 09:44:55 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:33917 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753579AbdDKNo1 (ORCPT ); Tue, 11 Apr 2017 09:44:27 -0400 Received: by mail-wr0-f179.google.com with SMTP id z109so29249315wrb.1 for ; Tue, 11 Apr 2017 06:44:26 -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=mjcy7w16KQKlpXxu6f/uwCT4kXaEAVc5mkWqKuOfu7w=; b=RZL0UrXpfAuPImkLA8W0JzcKYNWfRgR/3EFMXEt8IUypchdJkAvsxRV6WZfEXfAMjp lo2C1rBbzqWk+Y5tKgBLwMdBI+W0ZjcpXFoxb5k71yu2Yj/5PA6778+b7ZQXsgc5zQ5b r8qmDjjP7BkhoOZZyGNdfbngnsZ3UegWnPtWo= 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=mjcy7w16KQKlpXxu6f/uwCT4kXaEAVc5mkWqKuOfu7w=; b=EWq1U5jTCmCxWFgF1oIfg+O4LZe7LaME2BLIe2NJJJKA9/9ff7+Aq9zgVfORmxbWKc noQo5q8VMzU8iMNdi350FUYRR0ccSTWTDSJiH4/lFdgmfRYW+QGcvtHN1FokNOrvumV2 y+En62EhgF0ORsrBcHGlH6PJP2AFOgt95PhT/QAqfWw7TvmO/gboig7JoPUHi57dLN8U tg1LEwqOlN+RM3LCcSDobukEJ/BSt+Kkl3kQFdStrzClZe4ALQyJhxOkVQC2rZfjYZU/ B7w/O2tkSZ2jzq159QYEpvjP+jS7czTzqBQduh9KrEY+X6KeSJPj2lsAuNuFToPQrZ2n A95A== X-Gm-Message-State: AN3rC/4ZrCjwUhhUZU3FmJyGv2yprcm+0NnX3KrQrsd8g95hpUbIk95c3KQ0cvq3DHwLIe0o X-Received: by 10.223.179.24 with SMTP id j24mr22615091wrd.172.1491918265199; Tue, 11 Apr 2017 06:44:25 -0700 (PDT) Received: from localhost.localdomain ([185.14.8.188]) by smtp.gmail.com with ESMTPSA id v186sm2572933wmv.2.2017.04.11.06.44.23 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 11 Apr 2017 06:44:24 -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 V3 13/16] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Date: Tue, 11 Apr 2017 15:43:12 +0200 Message-Id: <20170411134315.44135-14-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170411134315.44135-1-paolo.valente@linaro.org> References: <20170411134315.44135-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 2081784..549f030 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6439,20 +6439,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, @@ -6460,7 +6455,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,