Skip to content

Commit

Permalink
cfq-iosched: tweak the FIFO checking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Feb 11, 2007
1 parent 1792669 commit cb88741
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cb88741

Please sign in to comment.