From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by kanga.kvack.org (Postfix) with ESMTP id B65186B0011 for ; Wed, 18 May 2011 22:55:35 -0400 (EDT) Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p4J2tU5F008863 for ; Wed, 18 May 2011 19:55:31 -0700 Received: from gwb17 (gwb17.prod.google.com [10.200.2.17]) by wpaz17.hot.corp.google.com with ESMTP id p4J2tKwC025374 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 18 May 2011 19:55:29 -0700 Received: by gwb17 with SMTP id 17so880818gwb.29 for ; Wed, 18 May 2011 19:55:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20110519101056.ca8e86f6.kamezawa.hiroyu@jp.fujitsu.com> References: <1305766511-11469-1-git-send-email-yinghan@google.com> <1305766511-11469-2-git-send-email-yinghan@google.com> <20110519101056.ca8e86f6.kamezawa.hiroyu@jp.fujitsu.com> Date: Wed, 18 May 2011 19:55:29 -0700 Message-ID: Subject: Re: [PATCH][BUGFIX] memcg: fix a routine for counting pages in node (Re: [PATCH V2 2/2] memcg: add memory.numastat api for numa statistics From: Ying Han Content-Type: multipart/alternative; boundary=000e0cd6ed944c6a8004a3982331 Sender: owner-linux-mm@kvack.org List-ID: To: KAMEZAWA Hiroyuki Cc: KOSAKI Motohiro , Minchan Kim , Daisuke Nishimura , Balbir Singh , Tejun Heo , Pavel Emelyanov , Andrew Morton , Li Zefan , Mel Gorman , Christoph Lameter , Johannes Weiner , Rik van Riel , Hugh Dickins , Michal Hocko , Dave Hansen , Zhu Yanhai , linux-mm@kvack.org --000e0cd6ed944c6a8004a3982331 Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 18, 2011 at 6:10 PM, KAMEZAWA Hiroyuki < kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Wed, 18 May 2011 17:55:11 -0700 > Ying Han wrote: > $ cat /dev/cgroup/memory/memory.numa_stat > > total=317674 N0=101850 N1=72552 N2=30120 N3=113142 > > file=288219 N0=98046 N1=59220 N2=23578 N3=107375 > > anon=25699 N0=3804 N1=10124 N2=6540 N3=5231 > > > > Note: I noticed is not equal to the sum of the rest of > counters. > > I might need to change the way get that counter, comments are welcomed. > > > > Please debug when you feel strange ;) > > Here is a fix. Could you test ? > Thanks for the patch. I will test it and post it again. --Ying > > == > The value for counter base should be initialized. If not, > this returns wrong value. > > Signed-off-by: KAMEZAWA Hiroyuki > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: mmotm-May11/mm/memcontrol.c > =================================================================== > --- mmotm-May11.orig/mm/memcontrol.c > +++ mmotm-May11/mm/memcontrol.c > @@ -710,7 +710,7 @@ static unsigned long > mem_cgroup_get_zonestat_node(struct mem_cgroup *mem, int nid, enum > lru_list idx) > { > struct mem_cgroup_per_zone *mz; > - u64 total; > + u64 total = 0; > int zid; > > for (zid = 0; zid < MAX_NR_ZONES; zid++) { > > --000e0cd6ed944c6a8004a3982331 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, May 18, 2011 at 6:10 PM, KAMEZAW= A Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
On Wed, 18 May 2011 17:55:11 -0700
Ying Han <yinghan@google.com&g= t; wrote:
$ cat /dev/cgroup/memory/memory.numa_stat
> total=3D317674 N0=3D101850 N1=3D72552 N2=3D30120 N3=3D113142
> file=3D288219 N0=3D98046 N1=3D59220 N2=3D23578 N3=3D107375
> anon=3D25699 N0=3D3804 N1=3D10124 N2=3D6540 N3=3D5231
>
> Note: I noticed <total pages> is not equal to the sum of the res= t of counters.
> I might need to change the way get that counter, comments are welcomed= .
>

Please debug when you feel strange ;)

Here is a fix. Could you test ?

Thanks = for the patch. I will test it and post it again.

-= -Ying=A0

=3D=3D
The value for counter base should be initialized. If not,
this returns wrong value.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
=A0mm/memcontrol.c | =A0 =A02 +-
=A01 file changed, 1 insertion(+), 1 deletion(-)

Index: mmotm-May11/mm/memcontrol.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- mmotm-May11.orig/mm/memcontrol.c
+++ mmotm-May11/mm/memcontrol.c
@@ -710,7 +710,7 @@ static unsigned long
=A0mem_cgroup_get_zonestat_node(struct mem_cgroup *mem, int nid, enum lru_l= ist idx)
=A0{
=A0 =A0 =A0 =A0struct mem_cgroup_per_zone *mz;
- =A0 =A0 =A0 u64 total;
+ =A0 =A0 =A0 u64 total =3D 0;
=A0 =A0 =A0 =A0int zid;

=A0 =A0 =A0 =A0for (zid =3D 0; zid < MAX_NR_ZONES; zid++) {


--000e0cd6ed944c6a8004a3982331-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org