From patchwork Sat Mar 4 16:01:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 94887 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp718195qgd; Sat, 4 Mar 2017 08:03:04 -0800 (PST) X-Received: by 10.84.210.33 with SMTP id z30mr12420541plh.79.1488643384821; Sat, 04 Mar 2017 08:03:04 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si13795149pgg.187.2017.03.04.08.03.04; Sat, 04 Mar 2017 08:03:04 -0800 (PST) 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 S1752369AbdCDQDC (ORCPT + 25 others); Sat, 4 Mar 2017 11:03:02 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:34765 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571AbdCDQCg (ORCPT ); Sat, 4 Mar 2017 11:02:36 -0500 Received: by mail-wm0-f47.google.com with SMTP id 196so12365907wmm.1 for ; Sat, 04 Mar 2017 08:02:30 -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=lgZXcwg1WyaweOUnLPsVCuPV3hu7ViXbHgBKxkicgZI=; b=Cqzps1/16PNTm9b/r+YZbA+Jop6UPIZ7kElYfK+OKWnv8kVLzHkFOnrYoEItlToA6C oMwMN/8inrJh9PqsNOpTZCVrDXPrsL9tRtUGlJvXPxIpIkLqom8aODtL9JQzwh49UBLy 5s7qeZh5f8vcWsILYZpnq8+K4d9fxQYmP5wwA= 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=lgZXcwg1WyaweOUnLPsVCuPV3hu7ViXbHgBKxkicgZI=; b=AbrP2iQTtBTWhT15fkmDoewL8EKt6AGDaBKMEepQ/qFmpu8hJUx5lFVlwczjCesqo7 E+FXWKQwgKp8+gBoqEmiY9qq0oMQqD7uJ02FwGCVjTWi9HV9dxLtvd6mX4muw/W6w/Tg ZldH5NGCcfgwfJ1+8yjtmX8he0dGnU20HGDYyX7Nz3gjiFM2s66WfVRAVFb7DwnhuwM8 +QglyaLYUNKkNEt3R5uidymwL3QnIuQi6u4tSBEWOE6GivK5KrdmVjMu3YQwsr5k6AfC FTGVYzRq5JvxguiLGy8BNZ0nDm/guHa+5Syxt5t6o/zmteOIigd3bNFiucHGPEciCyJt k9aQ== X-Gm-Message-State: AMke39krOTcD0NrhI0fmKMgeYsvIVO4ix9sx9S4JoxffzbZPhygpILEvtT8SzNYkDTFlwX3b X-Received: by 10.28.97.194 with SMTP id v185mr6908048wmb.117.1488643349793; Sat, 04 Mar 2017 08:02:29 -0800 (PST) Received: from localhost.localdomain ([185.14.10.61]) by smtp.gmail.com with ESMTPSA id g6sm7474035wmc.30.2017.03.04.08.02.27 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 04 Mar 2017 08:02:28 -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 08/14] block, bfq: preserve a low latency also with NCQ-capable drives Date: Sat, 4 Mar 2017 17:01:25 +0100 Message-Id: <20170304160131.57366-9-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I/O schedulers typically allow NCQ-capable drives to prefetch I/O requests, as NCQ boosts the throughput exactly by prefetching and internally reordering requests. Unfortunately, as discussed in detail and shown experimentally in [1], this may cause fairness and latency guarantees to be violated. The main problem is that the internal scheduler of an NCQ-capable drive may postpone the service of some unlucky (prefetched) requests as long as it deems serving other requests more appropriate to boost the throughput. This patch addresses this issue by not disabling device idling for weight-raised queues, even if the device supports NCQ. This allows BFQ to start serving a new queue, and therefore allows the drive to prefetch new requests, only after the idling timeout expires. At that time, all the outstanding requests of the expired queue have been most certainly served. [1] P. Valente and M. Andreolini, "Improving Application Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of the 5th Annual International Systems and Storage Conference (SYSTOR '12), June 2012. Slightly extended version: http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite- results.pdf Signed-off-by: Paolo Valente Signed-off-by: Arianna Avanzini --- block/bfq-iosched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.10.0 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index bc47591..b439779 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6180,7 +6180,8 @@ static void bfq_update_idle_window(struct bfq_data *bfqd, if (atomic_read(&bic->icq.ioc->active_ref) == 0 || bfqd->bfq_slice_idle == 0 || - (bfqd->hw_tag && BFQQ_SEEKY(bfqq))) + (bfqd->hw_tag && BFQQ_SEEKY(bfqq) && + bfqq->wr_coeff == 1)) enable_idle = 0; else if (bfq_sample_valid(bfqq->ttime.ttime_samples)) { if (bfqq->ttime.ttime_mean > bfqd->bfq_slice_idle &&