aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>2009-12-15 04:08:45 -0500
committerJens Axboe <jens.axboe@oracle.com>2009-12-15 04:08:45 -0500
commit66ae291978177d5c012015f12b8fbc76dc7d0965 (patch)
tree1351d66beea2b0b2300a7491ca8d9ffb83578e34 /block
parent82bbbf28db4beefcd8b897800153e21378270cd1 (diff)
cfq: set workload as expired if it doesn't have any slice left
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>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index f3f62394b986..e2f80463ed0d 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2113,7 +2113,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
2113 cfqd->workload_expires = jiffies + cfqg->saved_workload_slice; 2113 cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
2114 cfqd->serving_type = cfqg->saved_workload; 2114 cfqd->serving_type = cfqg->saved_workload;
2115 cfqd->serving_prio = cfqg->saved_serving_prio; 2115 cfqd->serving_prio = cfqg->saved_serving_prio;
2116 } 2116 } else
2117 cfqd->workload_expires = jiffies - 1;
2118
2117 choose_service_tree(cfqd, cfqg); 2119 choose_service_tree(cfqd, cfqg);
2118} 2120}
2119 2121