Commit 4d00aa47 authored by Jeff Moyer's avatar Jeff Moyer Committed by Jens Axboe

cfq-iosched: make seek_mean converge more quickly

Right now, depending on the first sector to which a process issues I/O,
the seek time may start out way out of whack. So make sure we start
with 0 sectors in seek, instead of the offset of the first request
issued.
Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent b7591134
...@@ -1908,7 +1908,9 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_io_context *cic, ...@@ -1908,7 +1908,9 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_io_context *cic,
sector_t sdist; sector_t sdist;
u64 total; u64 total;
if (cic->last_request_pos < rq->sector) if (!cic->last_request_pos)
sdist = 0;
else if (cic->last_request_pos < rq->sector)
sdist = rq->sector - cic->last_request_pos; sdist = rq->sector - cic->last_request_pos;
else else
sdist = cic->last_request_pos - rq->sector; sdist = cic->last_request_pos - rq->sector;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment