public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq: set workload as expired if it doesn't have any slice left.
@ 2009-12-15  1:53 Gui Jianfeng
  2009-12-15  9:07 ` Jens Axboe
  2009-12-15 14:28 ` Vivek Goyal
  0 siblings, 2 replies; 3+ messages in thread
From: Gui Jianfeng @ 2009-12-15  1:53 UTC (permalink / raw)
  To: Corrado Zoccolo, Vivek Goyal, Jens Axboe; +Cc: linux kernel mailing list

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>
---
 block/cfq-iosched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index f3f6239..e2f8046 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -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);
 }
 
-- 
1.5.4.rc3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-15 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15  1:53 [PATCH] cfq: set workload as expired if it doesn't have any slice left Gui Jianfeng
2009-12-15  9:07 ` Jens Axboe
2009-12-15 14:28 ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox