lkml.org 
[lkml]   [2009]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 24/23] io-controller: Don't leave a queue active when a disk is idle

o It is possible that when there is only a single queue in the system, it
remains unexpired for a long time (because there is no IO activity on the
disk). So when next request comes in after a long time, it might make
scheduler think that all this while queue used the disk and it will assign
a high vdisktime to the queue. Hence make sure queue is expired once all
the requests have completed from the queue.

o Also avoid unnecessarily expiring a queue when it has got one request
dispatched to the queue and waiting for it to finish and it does not have
more requests queued to dispatch.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
block/elevator-fq.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Index: linux16/block/elevator-fq.c
===================================================================
--- linux16.orig/block/elevator-fq.c 2009-09-08 15:43:36.000000000 -0400
+++ linux16/block/elevator-fq.c 2009-09-08 15:44:21.000000000 -0400
@@ -2947,6 +2947,10 @@ void *elv_select_ioq(struct request_queu
if (ioq == NULL)
goto new_queue;

+ /* There is only one active queue which is empty. Nothing to dispatch */
+ if (elv_nr_busy_ioq(q->elevator) == 1 && !ioq->nr_queued)
+ return NULL;
+
iog = ioq_to_io_group(ioq);

/*
@@ -3236,6 +3240,17 @@ void elv_ioq_completed_request(struct re
else
elv_iog_arm_slice_timer(q, iog, 0);
}
+
+ /*
+ * if this is only queue and it has completed all its requests
+ * and has nothing to dispatch, expire it. We don't want to
+ * keep it around idle otherwise later when it is expired, all
+ * this idle time will be added to queue's disk time used.
+ */
+ if (efqd->busy_queues == 1 && !ioq->dispatched &&
+ !ioq->nr_queued && !timer_pending(&efqd->idle_slice_timer)) {
+ elv_slice_expired(q);
+ }
}
done:
if (!efqd->rq_in_driver)

\
 
 \ /
  Last update: 2009-09-09 00:31    [W:0.188 / U:3.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site