public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: Get rid of on_st flag
@ 2010-11-30  8:41 Gui Jianfeng
  2010-11-30 14:23 ` Vivek Goyal
  2010-11-30 19:53 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Gui Jianfeng @ 2010-11-30  8:41 UTC (permalink / raw)
  To: Jens Axboe, Vivek Goyal; +Cc: linux kernel mailing list

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

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
 block/cfq-iosched.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index e18d316..5d0349d 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -179,7 +179,6 @@ struct cfq_group {
 	/* group service_tree key */
 	u64 vdisktime;
 	unsigned int weight;
-	bool on_st;
 
 	/* number of cfqq currently on this group */
 	int nr_cfqq;
@@ -863,7 +862,7 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
 	struct rb_node *n;
 
 	cfqg->nr_cfqq++;
-	if (cfqg->on_st)
+	if (!RB_EMPTY_NODE(&cfqg->rb_node))
 		return;
 
 	/*
@@ -879,7 +878,6 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
 		cfqg->vdisktime = st->min_vdisktime;
 
 	__cfq_group_service_tree_add(st, cfqg);
-	cfqg->on_st = true;
 	st->total_weight += cfqg->weight;
 }
 
@@ -896,7 +894,6 @@ cfq_group_service_tree_del(struct cfq_data *cfqd, struct cfq_group *cfqg)
 		return;
 
 	cfq_log_cfqg(cfqd, cfqg, "del_from_rr group");
-	cfqg->on_st = false;
 	st->total_weight -= cfqg->weight;
 	if (!RB_EMPTY_NODE(&cfqg->rb_node))
 		cfq_rb_erase(&cfqg->rb_node, st);
-- 
1.6.5.2



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

* Re: [PATCH] cfq-iosched: Get rid of on_st flag
  2010-11-30  8:41 [PATCH] cfq-iosched: Get rid of on_st flag Gui Jianfeng
@ 2010-11-30 14:23 ` Vivek Goyal
  2010-11-30 19:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Vivek Goyal @ 2010-11-30 14:23 UTC (permalink / raw)
  To: Gui Jianfeng; +Cc: Jens Axboe, linux kernel mailing list

On Tue, Nov 30, 2010 at 04:41:31PM +0800, Gui Jianfeng wrote:
> It's able to check whether a CFQ group on a service tree by
> checking "cfqg->rb_node". There's no need to maintain an
> extra flag here.
> 
> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> Acked-by: Vivek Goyal <vgoyal@redhat.com>

Looks good to me.

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> ---
>  block/cfq-iosched.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index e18d316..5d0349d 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -179,7 +179,6 @@ struct cfq_group {
>  	/* group service_tree key */
>  	u64 vdisktime;
>  	unsigned int weight;
> -	bool on_st;
>  
>  	/* number of cfqq currently on this group */
>  	int nr_cfqq;
> @@ -863,7 +862,7 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
>  	struct rb_node *n;
>  
>  	cfqg->nr_cfqq++;
> -	if (cfqg->on_st)
> +	if (!RB_EMPTY_NODE(&cfqg->rb_node))
>  		return;
>  
>  	/*
> @@ -879,7 +878,6 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
>  		cfqg->vdisktime = st->min_vdisktime;
>  
>  	__cfq_group_service_tree_add(st, cfqg);
> -	cfqg->on_st = true;
>  	st->total_weight += cfqg->weight;
>  }
>  
> @@ -896,7 +894,6 @@ cfq_group_service_tree_del(struct cfq_data *cfqd, struct cfq_group *cfqg)
>  		return;
>  
>  	cfq_log_cfqg(cfqd, cfqg, "del_from_rr group");
> -	cfqg->on_st = false;
>  	st->total_weight -= cfqg->weight;
>  	if (!RB_EMPTY_NODE(&cfqg->rb_node))
>  		cfq_rb_erase(&cfqg->rb_node, st);
> -- 
> 1.6.5.2
> 

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

* Re: [PATCH] cfq-iosched: Get rid of on_st flag
  2010-11-30  8:41 [PATCH] cfq-iosched: Get rid of on_st flag Gui Jianfeng
  2010-11-30 14:23 ` Vivek Goyal
@ 2010-11-30 19:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2010-11-30 19:53 UTC (permalink / raw)
  To: Gui Jianfeng; +Cc: Vivek Goyal, linux kernel mailing list

On 2010-11-30 09:41, Gui Jianfeng wrote:
> It's able to check whether a CFQ group on a service tree by
> checking "cfqg->rb_node". There's no need to maintain an
> extra flag here.

Thanks, applied.

-- 
Jens Axboe


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

end of thread, other threads:[~2010-11-30 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30  8:41 [PATCH] cfq-iosched: Get rid of on_st flag Gui Jianfeng
2010-11-30 14:23 ` Vivek Goyal
2010-11-30 19:53 ` Jens Axboe

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