aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2009-04-21 01:25:04 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-22 02:35:11 -0400
commit4d00aa47e2337dcfe2d8a7215dbde3765b507167 (patch)
tree069f0c202e6a3f3017b0a8b4320b31172bcc1071 /block/cfq-iosched.c
parentb759113499d6c7cb75fab04f56772579308bc0f8 (diff)
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: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 0d3b70de3d80..0eb4aff9df68 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1908,7 +1908,9 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_io_context *cic,
1908 sector_t sdist; 1908 sector_t sdist;
1909 u64 total; 1909 u64 total;
1910 1910
1911 if (cic->last_request_pos < rq->sector) 1911 if (!cic->last_request_pos)
1912 sdist = 0;
1913 else if (cic->last_request_pos < rq->sector)
1912 sdist = rq->sector - cic->last_request_pos; 1914 sdist = rq->sector - cic->last_request_pos;
1913 else 1915 else
1914 sdist = cic->last_request_pos - rq->sector; 1916 sdist = cic->last_request_pos - rq->sector;