lkml.org 
[lkml]   [2009]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 12/24] io-controller: Wait for requests to complete from last queue before new queue is scheduled
Vivek Goyal wrote:
...
> void elv_schedule_dispatch(struct request_queue *q)
> @@ -2260,6 +2264,17 @@ void *elv_select_ioq(struct request_queue *q, int force)
> }
>
> expire:
> + if (efqd->fairness && !force && ioq && ioq->dispatched) {
> + /*
> + * If there are request dispatched from this queue, don't
> + * dispatch requests from new queue till all the requests from
> + * this queue have completed.
> + */
> + elv_log_ioq(efqd, ioq, "select: wait for requests to finish"
> + " disp=%lu", ioq->dispatched);
> + ioq = NULL;
> + goto keep_queue;
> + }
> elv_slice_expired(q);
> new_queue:
> ioq = elv_set_active_ioq(q, new_ioq);
> @@ -2375,6 +2390,10 @@ void elv_ioq_completed_request(struct request_queue *q, struct request *rq)
> goto done;
> }
>
> + /* Wait for requests to finish from this queue */
> + if (efqd->fairness && ioq->dispatched)

Since we have the routing to access to ioq->dispatched, why not to use it.

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
block/elevator-fq.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/elevator-fq.c b/block/elevator-fq.c
index d04e925..f1e0de5 100644
--- a/block/elevator-fq.c
+++ b/block/elevator-fq.c
@@ -3120,7 +3120,7 @@ void elv_ioq_completed_request(struct request_queue *q, struct request *rq)
}

/* Wait for requests to finish from this queue */
- if (efqd->fairness && ioq->dispatched)
+ if (efqd->fairness && elv_ioq_nr_dispatched(ioq))
goto done;

/* Expire the queue */
@@ -3135,7 +3135,7 @@ void elv_ioq_completed_request(struct request_queue *q, struct request *rq)
* If this is the last queue in the group and we did not
* decide to idle on queue, idle on group.
*/
- if (elv_iog_should_idle(ioq) && !ioq->dispatched
+ if (elv_iog_should_idle(ioq) && !elv_ioq_nr_dispatched(ioq)
&& !timer_pending(&efqd->idle_slice_timer)) {
/*
* If queue has used up its slice, wait for the
--
1.5.4.rc3


\
 
 \ /
  Last update: 2009-08-24 05:33    [W:0.174 / U:3.528 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site