linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: avoid slice overrun when idling
@ 2009-10-07  8:59 Corrado Zoccolo
  2009-10-07 17:51 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Corrado Zoccolo @ 2009-10-07  8:59 UTC (permalink / raw)
  To: Linux-Kernel, Jens Axboe, Jeff Moyer

Idle window for a queue is reduced when the queue is about to finish
its slice.

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
---
 block/cfq-iosched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4ab33d8..55bb8ca 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1105,8 +1105,10 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
 	 * we don't want to idle for seeks, but we do want to allow
 	 * fair distribution of slice time for a process doing back-to-back
 	 * seeks. so allow a little bit of time for him to submit a new rq
+	 * but avoid overrunning its timeslice
 	 */
-	sl = cfqd->cfq_slice_idle;
+	sl = min_t(unsigned long, cfqd->cfq_slice_idle,
+		cfqq->slice_end - jiffies);
 	if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
 		sl = min(sl, msecs_to_jiffies(CFQ_MIN_TT));
 
-- 
1.6.2.5




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-08  6:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07  8:59 [PATCH] cfq-iosched: avoid slice overrun when idling Corrado Zoccolo
2009-10-07 17:51 ` Jens Axboe
2009-10-07 19:30   ` Corrado Zoccolo
2009-10-07 21:15     ` [PATCH v2] cfq-iosched: avoid probable " Corrado Zoccolo
2009-10-08  6:41       ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).