From: Corrado Zoccolo <czoccolo@gmail.com>
To: "Linux-Kernel" <linux-kernel@vger.kernel.org>,
Jens Axboe <jens.axboe@oracle.com>,
Jeff Moyer <jmoyer@redhat.com>
Subject: [PATCH] cfq: enable idle for seeky processes on rotational NCQ devices
Date: Sun, 4 Oct 2009 18:37:34 +0200 [thread overview]
Message-ID: <200910041837.34546.czoccolo@gmail.com> (raw)
Disabled idle window cause large latencies when seeky processes are competing
with async writes, for rotational NCQ devices.
This patch, based on Vivek Goyal's original idea (http://lkml.org/lkml/2009/7/12/110),
unconditionally enables idle window for seeky processes on rotational NCQ devices.
As for non-NCQ devices, a smaller idle window (2ms) is used
for seeky processes compared to normal I/O (8ms).
RAIDs should be marked as non-rotational as well (and probably a better flag
name should be devised), since they can carry multiple operations in parallel.
Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
---
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index ebab60c..576e92d 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1981,10 +1981,14 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq,
enable_idle = old_idle = cfq_cfqq_idle_window(cfqq);
if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle ||
- (!cfqd->cfq_latency && cfqd->hw_tag && CIC_SEEKY(cic)))
+ (blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag && CIC_SEEKY(cic)))
enable_idle = 0;
else if (sample_valid(cic->ttime_samples)) {
- if (cic->ttime_mean > cfqd->cfq_slice_idle)
+ unsigned idle_time = cfqd->cfq_slice_idle;
+ if (CIC_SEEKY(cic))
+ idle_time = CFQ_MIN_TT;
+
+ if (cic->ttime_mean > idle_time)
enable_idle = 0;
else
enable_idle = 1;
next reply other threads:[~2009-10-04 16:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-04 16:37 Corrado Zoccolo [this message]
2009-10-04 17:36 ` [PATCH] cfq: enable idle for seeky processes on rotational NCQ devices Jens Axboe
2009-10-04 18:29 ` Corrado Zoccolo
2009-10-04 18:39 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2009-10-03 8:57 Corrado Zoccolo
2009-10-03 13:50 ` 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=200910041837.34546.czoccolo@gmail.com \
--to=czoccolo@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.kernel.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.