cfq: set workload as expired if it doesn't have any slice left
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>
Tue, 15 Dec 2009 09:08:45 +0000 (10:08 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 15 Dec 2009 09:08:45 +0000 (10:08 +0100)
When a group is resumed, if it doesn't have workload slice left,
we should set workload_expires as expired. Otherwise, we might
start from where we left in previous group by error.
Thanks the idea from Corrado.

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/cfq-iosched.c

index f3f62394b98637aeb79c32848d873abfdd844578..e2f80463ed0d621df96bef311543f714462d7f7d 100644 (file)
@@ -2113,7 +2113,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
                cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
                cfqd->serving_type = cfqg->saved_workload;
                cfqd->serving_prio = cfqg->saved_serving_prio;
-       }
+       } else
+               cfqd->workload_expires = jiffies - 1;
+
        choose_service_tree(cfqd, cfqg);
 }