diff --git a/[refs] b/[refs] index 0698afb6bdd9..d94e0bc5bb88 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0b182d617eb50762b483658dd6dd9a9fbcb25758 +refs/heads/master: b9c8946b192397394a0ccd4fcecb31bc060f79f8 diff --git a/trunk/block/cfq-iosched.c b/trunk/block/cfq-iosched.c index 5c3cee93329a..4ab33d8a20b2 100644 --- a/trunk/block/cfq-iosched.c +++ b/trunk/block/cfq-iosched.c @@ -507,8 +507,14 @@ static void cfq_service_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq, } else rb_key += jiffies; } else if (!add_front) { + /* + * Get our rb key offset. Subtract any residual slice + * value carried from last service. A negative resid + * count indicates slice overrun, and this should position + * the next service time further away in the tree. + */ rb_key = cfq_slice_offset(cfqd, cfqq) + jiffies; - rb_key += cfqq->slice_resid; + rb_key -= cfqq->slice_resid; cfqq->slice_resid = 0; } else { rb_key = -HZ;