From patchwork Fri Jun 19 06:26:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Jianfeng X-Patchwork-Id: 31291 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5J6SbAB023339 for ; Fri, 19 Jun 2009 06:28:37 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 8F5F161A2DB; Fri, 19 Jun 2009 02:28:36 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n5J6SVRU011693 for ; Fri, 19 Jun 2009 02:28:31 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with SMTP id n5J6SR9E032358; Fri, 19 Jun 2009 02:28:27 -0400 Received: from song.cn.fujitsu.com (cn.fujitsu.com [222.73.24.84] (may be forged)) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id n5J6SAxM010738; Fri, 19 Jun 2009 02:28:11 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 60019170080; Fri, 19 Jun 2009 14:57:46 +0800 (CST) Received: from fnst.cn.fujitsu.com (localhost.localdomain [127.0.0.1]) by tang.cn.fujitsu.com (8.13.1/8.13.1) with ESMTP id n5J6m9vE011405; Fri, 19 Jun 2009 14:48:09 +0800 Received: from [127.0.0.1] (unknown [10.167.141.226]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 190F1D4016; Fri, 19 Jun 2009 14:29:10 +0800 (CST) Message-ID: <4A3B2F7E.10405@cn.fujitsu.com> Date: Fri, 19 Jun 2009 14:26:06 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal References: <1244513342-11758-1-git-send-email-vgoyal@redhat.com> <1244513342-11758-19-git-send-email-vgoyal@redhat.com> In-Reply-To: <1244513342-11758-19-git-send-email-vgoyal@redhat.com> X-RedHat-Spam-Score: -0.818 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.31 X-loop: dm-devel@redhat.com Cc: dhaval@linux.vnet.ibm.com, snitzer@redhat.com, peterz@infradead.org, dm-devel@redhat.com, dpshah@google.com, jens.axboe@oracle.com, agk@redhat.com, balbir@linux.vnet.ibm.com, paolo.valente@unimore.it, fernando@oss.ntt.co.jp, mikew@google.com, jmoyer@redhat.com, nauman@google.com, m-ikeda@ds.jp.nec.com, lizf@cn.fujitsu.com, fchecconi@gmail.com, akpm@linux-foundation.org, jbaron@redhat.com, linux-kernel@vger.kernel.org, s-uchida@ap.jp.nec.com, righi.andrea@gmail.com, containers@lists.linux-foundation.org Subject: [dm-devel] Re: [PATCH 18/19] io-controller: Debug hierarchical IO scheduling X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- 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(); }