public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq: Make use of service count to estimate the rb_key offset
@ 2009-11-26  6:20 Gui Jianfeng
  2009-11-26  8:14 ` Jens Axboe
  2009-11-26  9:08 ` Corrado Zoccolo
  0 siblings, 2 replies; 11+ messages in thread
From: Gui Jianfeng @ 2009-11-26  6:20 UTC (permalink / raw)
  To: Jens Axboe, czoccolo; +Cc: Vivek Goyal, linux-kernel

Hi Jens, Czoccolo

For the moment, different workload cfq queues are put into different
service trees. But CFQ still uses "busy_queues" to estimate rb_key 
offset when inserting a cfq queue into a service tree. I think this 
isn't appropriate, and it should make use of service tree count to do 
this estimation. This patch is for for-2.6.33 branch.

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
 block/cfq-iosched.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 1bcbd8c..467981e 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -600,11 +600,15 @@ cfq_find_next_rq(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 static unsigned long cfq_slice_offset(struct cfq_data *cfqd,
 				      struct cfq_queue *cfqq)
 {
+	struct cfq_rb_root *service_tree;
+
+	service_tree = service_tree_for(cfqq_prio(cfqq), cfqq_type(cfqq), cfqd);
+
 	/*
 	 * just an approximation, should be ok.
 	 */
-	return (cfqd->busy_queues - 1) * (cfq_prio_slice(cfqd, 1, 0) -
-		       cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio));
+	return  service_tree->count * (cfq_prio_slice(cfqd, 1, 0) -
+		   cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio));
 }
 
 /*
-- 
1.5.4.rc3

-- 
Regards
Gui Jianfeng


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

end of thread, other threads:[~2009-11-30 21:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26  6:20 [PATCH] cfq: Make use of service count to estimate the rb_key offset Gui Jianfeng
2009-11-26  8:14 ` Jens Axboe
2009-11-26  9:08 ` Corrado Zoccolo
2009-11-27  1:42   ` Gui Jianfeng
2009-11-27  8:16     ` Corrado Zoccolo
2009-11-30  3:02       ` Gui Jianfeng
2009-11-30  8:38         ` Jens Axboe
2009-11-30 15:36   ` Vivek Goyal
2009-11-30 16:01     ` Corrado Zoccolo
2009-11-30 16:46       ` Vivek Goyal
2009-11-30 21:56         ` Corrado Zoccolo

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