cfq-iosched: tweak the FIFO checking
authorJens Axboe <jens.axboe@oracle.com>
Fri, 19 Jan 2007 01:01:16 +0000 (12:01 +1100)
committerJens Axboe <axboe@carl.home.kernel.dk>
Sun, 11 Feb 2007 22:14:45 +0000 (23:14 +0100)
We currently check the FIFO once per slice. Optimize that a bit and
only do it as the first thing for a new slice, so we don't end up
doing a single request and then seek to the FIFO requests.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/cfq-iosched.c

index 3df41a00b55326271ba05c289da62a8d8491710b..03b1e474b2bf28c670f7868bf0c23dde1ad38ee2 100644 (file)
@@ -885,16 +885,17 @@ static inline struct request *cfq_check_fifo(struct cfq_queue *cfqq)
 
        if (cfq_cfqq_fifo_expire(cfqq))
                return NULL;
+
+       cfq_mark_cfqq_fifo_expire(cfqq);
+
        if (list_empty(&cfqq->fifo))
                return NULL;
 
        fifo = cfq_cfqq_class_sync(cfqq);
        rq = rq_entry_fifo(cfqq->fifo.next);
 
-       if (time_after(jiffies, rq->start_time + cfqd->cfq_fifo_expire[fifo])) {
-               cfq_mark_cfqq_fifo_expire(cfqq);
+       if (time_after(jiffies, rq->start_time + cfqd->cfq_fifo_expire[fifo]))
                return rq;
-       }
 
        return NULL;
 }