From 643dfd19e1143521e24a76d8671c1c0b9e1f90a3 Mon Sep 17 00:00:00 2001 From: Corrado Zoccolo Date: Fri, 20 Nov 2009 14:55:54 +0100 Subject: [PATCH 2/2] cfq-iosched: idling on deep seeky sync queues Seeky sync queues with large depth can gain unfairly big share of disk time, at the expense of other seeky queues. This patch ensures that idling will be enabled for queues with I/O depth at least 4. The reasoning behind the decision is that, if an application is using large I/O depth, it is already optimized to make full utilization of the hardware, and therefore we reserve a slice of exclusive use for it. Signed-off-by: Corrado Zoccolo --- block/cfq-iosched.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index a8f7a26..4f67bc2 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2359,8 +2359,10 @@ 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 || - (sample_valid(cfqq->seek_samples) && CFQQ_SEEKY(cfqq))) + if (cfqq->queued[0] + cfqq->queued[1] >= 4) + enable_idle = 1; + else if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle || + (sample_valid(cfqq->seek_samples) && CFQQ_SEEKY(cfqq))) enable_idle = 0; else if (sample_valid(cic->ttime_samples)) { if (cic->ttime_mean > cfqd->cfq_slice_idle) -- 1.6.2.5