diff mbox

Re: [PATCH 18/19] io-controller: Debug hierarchical IO scheduling

Message ID 4A3B2F7E.10405@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gui Jianfeng June 19, 2009, 6:26 a.m. UTC
Vivek Goyal wrote:
...
> +static inline void bfq_account_for_entity_addition(struct io_entity *entity)
> +{
> +	struct io_group *iog = io_entity_to_iog(entity);
> +
> +	if (iog) {
> +		struct elv_fq_data *efqd;
> +		char path[128];
> +
> +		/*
> +		 * Keep track of how many times a group has been removed
> +		 * from active tree because it did not have any active
> +		 * backlogged ioq under it
> +		 */
> +		iog->queue++;
> +		iog->queue_start = jiffies;
> +
> +		/* Log group addition event */
> +		rcu_read_lock();
> +		efqd = rcu_dereference(iog->key);
> +		if (efqd) {
> +			io_group_path(iog, path, sizeof(path));
> +			elv_log(efqd, "add group=%s weight=%ld", path,
> +					iog->entity.weight);

Since cgroup path is already cached, why not use it. :)

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

Comments

Vivek Goyal June 19, 2009, 2:08 p.m. UTC | #1
On Fri, Jun 19, 2009 at 02:26:06PM +0800, Gui Jianfeng wrote:
> Vivek Goyal wrote:
> ...
> > +static inline void bfq_account_for_entity_addition(struct io_entity *entity)
> > +{
> > +	struct io_group *iog = io_entity_to_iog(entity);
> > +
> > +	if (iog) {
> > +		struct elv_fq_data *efqd;
> > +		char path[128];
> > +
> > +		/*
> > +		 * Keep track of how many times a group has been removed
> > +		 * from active tree because it did not have any active
> > +		 * backlogged ioq under it
> > +		 */
> > +		iog->queue++;
> > +		iog->queue_start = jiffies;
> > +
> > +		/* Log group addition event */
> > +		rcu_read_lock();
> > +		efqd = rcu_dereference(iog->key);
> > +		if (efqd) {
> > +			io_group_path(iog, path, sizeof(path));
> > +			elv_log(efqd, "add group=%s weight=%ld", path,
> > +					iog->entity.weight);
> 
> Since cgroup path is already cached, why not use it. :)
> 

Thanks Gui. Queued for next posting.

Vivek

> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> ---
>  block/elevator-fq.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/block/elevator-fq.c b/block/elevator-fq.c
> index bfa79c9..1a397c3 100644
> --- a/block/elevator-fq.c
> +++ b/block/elevator-fq.c
> @@ -183,7 +183,6 @@ static inline void bfq_account_for_entity_addition(struct io_entity *entity)
>  
>  	if (iog) {
>  		struct elv_fq_data *efqd;
> -		char path[128];
>  
>  		/*
>  		 * Keep track of how many times a group has been removed
> @@ -197,9 +196,8 @@ static inline void bfq_account_for_entity_addition(struct io_entity *entity)
>  		rcu_read_lock();
>  		efqd = rcu_dereference(iog->key);
>  		if (efqd) {
> -			io_group_path(iog, path, sizeof(path));
> -			elv_log(efqd, "add group=%s weight=%ld", path,
> -					iog->entity.weight);
> +			elv_log(efqd, "add group=%s weight=%ld", iog->path,
> +				iog->entity.weight);
>  		}
>  		rcu_read_unlock();
>  	}
> @@ -215,7 +213,6 @@ static inline void bfq_account_for_entity_deletion(struct io_entity *entity)
>  
>  	if (iog) {
>  		struct elv_fq_data *efqd;
> -		char path[128];
>  
>  		iog->dequeue++;
>  		/* Keep a track of how long group was on active tree */
> @@ -227,9 +224,8 @@ static inline void bfq_account_for_entity_deletion(struct io_entity *entity)
>  		rcu_read_lock();
>  		efqd = rcu_dereference(iog->key);
>  		if (efqd) {
> -			io_group_path(iog, path, sizeof(path));
> -			elv_log(efqd, "del group=%s weight=%ld", path,
> -					iog->entity.weight);
> +			elv_log(efqd, "del group=%s weight=%ld", iog->path,
> +				iog->entity.weight);
>  		}
>  		rcu_read_unlock();
>  	}
> -- 
> 1.5.4.rc3
> 
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/block/elevator-fq.c b/block/elevator-fq.c
index bfa79c9..1a397c3 100644
--- a/block/elevator-fq.c
+++ b/block/elevator-fq.c
@@ -183,7 +183,6 @@  static inline void bfq_account_for_entity_addition(struct io_entity *entity)
 
 	if (iog) {
 		struct elv_fq_data *efqd;
-		char path[128];
 
 		/*
 		 * Keep track of how many times a group has been removed
@@ -197,9 +196,8 @@  static inline void bfq_account_for_entity_addition(struct io_entity *entity)
 		rcu_read_lock();
 		efqd = rcu_dereference(iog->key);
 		if (efqd) {
-			io_group_path(iog, path, sizeof(path));
-			elv_log(efqd, "add group=%s weight=%ld", path,
-					iog->entity.weight);
+			elv_log(efqd, "add group=%s weight=%ld", iog->path,
+				iog->entity.weight);
 		}
 		rcu_read_unlock();
 	}
@@ -215,7 +213,6 @@  static inline void bfq_account_for_entity_deletion(struct io_entity *entity)
 
 	if (iog) {
 		struct elv_fq_data *efqd;
-		char path[128];
 
 		iog->dequeue++;
 		/* Keep a track of how long group was on active tree */
@@ -227,9 +224,8 @@  static inline void bfq_account_for_entity_deletion(struct io_entity *entity)
 		rcu_read_lock();
 		efqd = rcu_dereference(iog->key);
 		if (efqd) {
-			io_group_path(iog, path, sizeof(path));
-			elv_log(efqd, "del group=%s weight=%ld", path,
-					iog->entity.weight);
+			elv_log(efqd, "del group=%s weight=%ld", iog->path,
+				iog->entity.weight);
 		}
 		rcu_read_unlock();
 	}