Skip to contentSkip to conversation

cfq-iosched: fix think time allowed for seekers

PATCH In review Corrado Zoccolo 2 participants 2 messages Oct 7, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfq-iosched: fix think time allowed for seekers

CFQ enables idle only for processes that think less than the allowed idle time. Since idle time is lower for seeky queues, we should use the correct value in the comparison.

---
 block/cfq-iosched.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
block/cfq-iosched.c +4 -1
index 55bb8ca..4c795a2 100644
@@ -1997,7 +1997,10 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 	    (!cfqd->cfq_latency && 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 int slice_idle = cfqd->cfq_slice_idle;
+		if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
+			slice_idle = msecs_to_jiffies(CFQ_MIN_TT);
+		if (cic->ttime_mean > slice_idle)
 			enable_idle = 0;
 		else
 			enable_idle = 1;
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 3 lines · Corrado Zoccolo

CFQ enables idle only for processes that think less than the allowed idle time. Since idle time is lower for seeky queues, we should use the correct value in the comparison.

Looks good, applied. Thanks!

Signature · 1 line
Jens Axboe