All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH 6/8] cfq-iosched: Get rid of on_st flag
@ 2010-11-15  0:57 Gui Jianfeng
  0 siblings, 0 replies; only message in thread
From: Gui Jianfeng @ 2010-11-15  0:57 UTC (permalink / raw)
  To: Vivek Goyal, Jens Axboe
  Cc: linux kernel mailing list, Corrado Zoccolo, Chad Talbott,
	Nauman Rafique, Divyesh Shah, Gui Jianfeng

It's able to check whether a CFQ group on a service tree by
checking "entity->rb_node". There's no need to maintain an
extra flag here.


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

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 1b9b4b2..1df0928 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -103,7 +103,6 @@ struct io_sched_entity {
 	struct rb_node rb_node;
 	/* service_tree key */
 	u64 vdisktime;
-	bool on_st;
 	bool is_group_entity;
 	unsigned int weight;
 };
@@ -890,8 +889,6 @@ io_entity_service_tree_add(struct cfq_rb_root *st,
 	__io_entity_service_tree_add(st, io_entity);
 	st->count++;
 	st->total_weight += io_entity->weight;
-	if (io_entity->is_group_entity)
-		io_entity->on_st = true;
 }
 
 static void
@@ -903,7 +900,7 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
 	struct io_sched_entity *__group_entity;
 
 	cfqg->nr_cfqq++;
-	if (group_entity->on_st)
+	if (!RB_EMPTY_NODE(&group_entity->rb_node))
 		return;
 
 	/*
@@ -936,8 +933,6 @@ io_entity_service_tree_del(struct cfq_rb_root *st,
 	if (!RB_EMPTY_NODE(&io_entity->rb_node)) {
 		__io_entity_service_tree_del(st, io_entity);
 		st->total_weight -= io_entity->weight;
-		if (io_entity->is_group_entity)
-			io_entity->on_st = false;
 		io_entity->service_tree = NULL;
 	}
 }
@@ -1070,7 +1065,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
 	RB_CLEAR_NODE(&cfqg->group_entity.rb_node);
 
 	cfqg->group_entity.is_group_entity = true;
-	cfqg->group_entity.on_st = false;
 
 	/*
 	 * Take the initial reference that will be released on destroy
@@ -3972,7 +3966,6 @@ static void *cfq_init_queue(struct request_queue *q)
 	/* Give preference to root group over other groups */
 	cfqg->group_entity.weight = 2*BLKIO_WEIGHT_DEFAULT;
 	cfqg->group_entity.is_group_entity = true;
-	cfqg->group_entity.on_st = false;
 
 #ifdef CONFIG_CFQ_GROUP_IOSCHED
 	/*
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-15  0:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-15  0:57 [RFC] [PATCH 6/8] cfq-iosched: Get rid of on_st flag Gui Jianfeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.