On Wed, May 18, 2011 at 7:55 PM, Ying Han <yinghan@xxxxxxxxxx> wrote:
On Wed, May 18, 2011 at 6:10 PM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
On Wed, 18 May 2011 17:55:11 -0700
Ying Han <yinghan@xxxxxxxxxx> 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 <total pages> 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 <kamezawa.hiroyu@xxxxxxxxxxxxxx>
---
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++) {