]> err.no Git - linux-2.6/commitdiff
[PATCH] cfq-iosched: busy_rr fairness fix
authorJens Axboe <axboe@suse.de>
Thu, 1 Jun 2006 16:53:43 +0000 (18:53 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 1 Jun 2006 16:53:43 +0000 (18:53 +0200)
Now that we select busy_rr for possible service, insert entries at the
back of that list instead of at the front.

Signed-off-by: Jens Axboe <axboe@suse.de>
block/cfq-iosched.c

index 85d188a30f8219d95e79fff7aa2d13d8b62efc4c..8e9d84825e1c519500288da6602b208fcec33995 100644 (file)
@@ -501,10 +501,13 @@ static void cfq_resort_rr_list(struct cfq_queue *cfqq, int preempted)
 
        /*
         * if queue was preempted, just add to front to be fair. busy_rr
-        * isn't sorted.
+        * isn't sorted, but insert at the back for fairness.
         */
        if (preempted || list == &cfqd->busy_rr) {
-               list_add(&cfqq->cfq_list, list);
+               if (preempted)
+                       list = list->prev;
+
+               list_add_tail(&cfqq->cfq_list, list);
                return;
        }