From patchwork Wed Apr 12 16:23:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 97304 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp345050qgf; Wed, 12 Apr 2017 09:24:31 -0700 (PDT) X-Received: by 10.98.4.195 with SMTP id 186mr48550362pfe.233.1492014271754; Wed, 12 Apr 2017 09:24:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si20944050pfb.23.2017.04.12.09.24.31; Wed, 12 Apr 2017 09:24:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754902AbdDLQYY (ORCPT + 16 others); Wed, 12 Apr 2017 12:24:24 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36213 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754857AbdDLQYT (ORCPT ); Wed, 12 Apr 2017 12:24:19 -0400 Received: by mail-wm0-f52.google.com with SMTP id o81so91824907wmb.1 for ; Wed, 12 Apr 2017 09:24:17 -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=WCMjYAyuiNZhfxi/yVXGCNjDF8wpwtMIuMyUXopElQ4RQr9ne+yqheB6T+z+h4PmQp 2dmsPAvWpNs7ys5lcQ+sYxV9eMJKMKgC4KMuy/RrJrRbed+yNJL7qce9FmhvvHnQayAN Lb9RbU0vvrX6JFr3p/+ZsQSbmVGEeN2H3vg3w= 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=lj6PRRYkBrIM4c3roaWWiNHFo9zEvx6JqQAwH60IurqQSKpGhcRVo797d5gCFBTOYG kzrMlXelqEHyDp4nHFvjaXZz4XYf9+LzQqZscfGc3hXPbhRBSew5wAyiHKI/+1ctFW/l /lzYyR6sIqLjK8stTonpoyzYk1cOIbFtaDih70TdW+22V1jBtFuT28zOKbyWhwrJ+2xo KEt6mfYbh1eUrA9nfuPa6SUqaENkbROj2ytb/ne6DJk0ovadiUUOhxEraxrfkzFV5GE4 hFqRkb96NMr35RQ2H9yqMbitDqq6DmmgEC58TNa8l9+vZIsg+pUnQdkJVRffryvA+PXf y6jQ== X-Gm-Message-State: AN3rC/6TJbx2zLrDAGrWd/ebfkVmP+mMbQ/AOPj3eKgc2uT2/Joye0wGiLwBXbxEV6Wnu8yu X-Received: by 10.28.97.2 with SMTP id v2mr3433907wmb.88.1492014251708; Wed, 12 Apr 2017 09:24:11 -0700 (PDT) Received: from localhost.localdomain ([185.14.8.188]) by smtp.gmail.com with ESMTPSA id a10sm26302738wra.17.2017.04.12.09.24.09 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 12 Apr 2017 09:24:10 -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 V4 13/16] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Date: Wed, 12 Apr 2017 18:23:19 +0200 Message-Id: <20170412162322.11139-14-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170412162322.11139-1-paolo.valente@linaro.org> References: <20170412162322.11139-1-paolo.valente@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.10.0 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,