Thread (10 messages) 10 messages, 5 authors, 2011-05-19

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 <hidden>
Date: 2011-05-19 02:55:35

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 [off-list ref] wrote:
$ cat /dev/cgroup/memory/memory.numa_stat
quoted
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 <total pages> is not equal to the sum of the rest of
counters.
quoted
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
quoted hunk ↗ jump to hunk
==
The value for counter base should be initialized. If not,
this returns wrong value.

Signed-off-by: KAMEZAWA Hiroyuki <redacted>
---
 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++) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help