diff options
author | Tejun Heo <htejun@gmail.com> | 2005-11-10 12:20:16 -0500 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2005-11-12 04:56:36 -0500 |
commit | b740d98f5614e34b4cff2e1e67826f007c8d4f30 (patch) | |
tree | 50ff24c84b2ecfc2e8e518b1d9aecf3be2bc8ec5 /block/cfq-iosched.c | |
parent | be56123568072d223263a6a70a087d1e7faabb83 (diff) |
[BLOCK] cfq-iosched: fix slice_left calculation
When cfq slice expires, remainder of slice is calculated and stored in
cfqq->slice_left. Current code calculates the opposite of remainder -
how many jiffies the cfqq has used past slice end. This patch fixes
the bug.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 452538644bce..2b64f5852bfd 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -861,8 +861,8 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
861 | * store what was left of this slice, if the queue idled out | 861 | * store what was left of this slice, if the queue idled out |
862 | * or was preempted | 862 | * or was preempted |
863 | */ | 863 | */ |
864 | if (time_after(now, cfqq->slice_end)) | 864 | if (time_after(cfqq->slice_end, now)) |
865 | cfqq->slice_left = now - cfqq->slice_end; | 865 | cfqq->slice_left = cfqq->slice_end - now; |
866 | else | 866 | else |
867 | cfqq->slice_left = 0; | 867 | cfqq->slice_left = 0; |
868 | 868 | ||