From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with ESMTP id 14AE26B0023 for ; Wed, 18 May 2011 23:53:28 -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 p4J3rPTI030813 for ; Wed, 18 May 2011 20:53:25 -0700 Received: from ywa1 (ywa1.prod.google.com [10.192.1.1]) by wpaz17.hot.corp.google.com with ESMTP id p4J3rLiD006670 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 18 May 2011 20:53:24 -0700 Received: by ywa1 with SMTP id 1so964353ywa.0 for ; Wed, 18 May 2011 20:53:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: 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 20:53:23 -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=000e0cd2574a5dcf8c04a398f243 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 --000e0cd2574a5dcf8c04a398f243 Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 18, 2011 at 7:55 PM, Ying Han wrote: > > > 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. > I tested and it doesn't fix the problem. Anyway, I will dig into that from now. thanks --Ying > > --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++) { >> >> > --000e0cd2574a5dcf8c04a398f243 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, May 18, 2011 at 7:55 PM, Ying Ha= n <yinghan@googl= e.com> wrote:


On Wed, May 18, 2011 a= t 6:10 PM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com<= /a>> wrote:
On Wed, 18 May 2011 17:55:11 -0700
Ying Han <
yingha= n@google.com> 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 ?

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

I tested and it doesn't fix the problem. Anyway= , I will dig into that from now.

thanks

--Ying

--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++) {



--000e0cd2574a5dcf8c04a398f243-- -- 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