Commit b740d98f authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe

[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: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent be561235
...@@ -861,8 +861,8 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, ...@@ -861,8 +861,8 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
* store what was left of this slice, if the queue idled out * store what was left of this slice, if the queue idled out
* or was preempted * or was preempted
*/ */
if (time_after(now, cfqq->slice_end)) if (time_after(cfqq->slice_end, now))
cfqq->slice_left = now - cfqq->slice_end; cfqq->slice_left = cfqq->slice_end - now;
else else
cfqq->slice_left = 0; cfqq->slice_left = 0;
......
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