All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Valente <paolo.valente@linaro.org>
To: Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>
Cc: Fabio Checconi <fchecconi@gmail.com>,
	Arianna Avanzini <avanzini.arianna@gmail.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	ulf.hansson@linaro.org, linus.walleij@linaro.org,
	broonie@kernel.org, Paolo Valente <paolo.valente@linaro.org>
Subject: [PATCH V4 08/16] block, bfq: preserve a low latency also with NCQ-capable drives
Date: Wed, 12 Apr 2017 18:23:14 +0200	[thread overview]
Message-ID: <20170412162322.11139-9-paolo.valente@linaro.org> (raw)
In-Reply-To: <20170412162322.11139-1-paolo.valente@linaro.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 <paolo.valente@linaro.org>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
---
 block/bfq-iosched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 7f94ad3..574a5f6 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -6233,7 +6233,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 &&
-- 
2.10.0

  parent reply	other threads:[~2017-04-12 16:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 16:23 [PATCH V4 00/16] Introduce the BFQ I/O scheduler Paolo Valente
2017-04-12 16:23 ` [PATCH V4 01/16] block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler Paolo Valente
2017-04-12 16:23 ` [PATCH V4 02/16] block, bfq: add full hierarchical scheduling and cgroups support Paolo Valente
2017-04-12 16:23 ` [PATCH V4 03/16] block, bfq: improve throughput boosting Paolo Valente
2017-04-12 16:23 ` [PATCH V4 04/16] block, bfq: modify the peak-rate estimator Paolo Valente
2017-04-12 16:23 ` [PATCH V4 05/16] block, bfq: add more fairness with writes and slow processes Paolo Valente
2017-04-12 16:23 ` [PATCH V4 06/16] block, bfq: improve responsiveness Paolo Valente
2017-04-12 16:23 ` [PATCH V4 07/16] block, bfq: reduce I/O latency for soft real-time applications Paolo Valente
2017-04-12 16:23 ` Paolo Valente [this message]
2017-04-12 16:23 ` [PATCH V4 09/16] block, bfq: reduce latency during request-pool saturation Paolo Valente
2017-04-12 16:23 ` [PATCH V4 10/16] block, bfq: add Early Queue Merge (EQM) Paolo Valente
2017-04-12 16:23 ` [PATCH V4 11/16] block, bfq: reduce idling only in symmetric scenarios Paolo Valente
2017-04-12 16:23 ` [PATCH V4 12/16] block, bfq: boost the throughput on NCQ-capable flash-based devices Paolo Valente
2017-04-12 16:23 ` [PATCH V4 13/16] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Paolo Valente
2017-04-12 16:23 ` [PATCH V4 14/16] block, bfq: handle bursts of queue activations Paolo Valente
2017-04-12 16:23 ` [PATCH V4 15/16] block, bfq: remove all get and put of I/O contexts Paolo Valente
2017-04-12 16:23 ` [PATCH V4 16/16] block, bfq: split bfq-iosched.c into multiple source files Paolo Valente
2017-04-19  9:23 ` [PATCH V4 00/16] Introduce the BFQ I/O scheduler Paolo Valente
2017-04-19  9:23   ` Paolo Valente
2017-04-19 14:33   ` Jens Axboe
2017-04-19 19:05     ` Paolo Valente
2017-04-19 19:05       ` Paolo Valente
2017-04-19 19:34       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170412162322.11139-9-paolo.valente@linaro.org \
    --to=paolo.valente@linaro.org \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=fchecconi@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.