linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Minchan Kim <minchan.kim@gmail.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Tejun Heo <tj@kernel.org>, Pavel Emelyanov <xemul@openvz.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Li Zefan <lizf@cn.fujitsu.com>, Mel Gorman <mel@csn.ul.ie>,
	Christoph Lameter <cl@linux.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
	Michal Hocko <mhocko@suse.cz>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Zhu Yanhai <zhu.yanhai@gmail.com>,
	linux-mm@kvack.org
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
Date: Wed, 18 May 2011 19:55:29 -0700	[thread overview]
Message-ID: <BANLkTimbbCBd0w5MpMCkTixTtukKGnyQCA@mail.gmail.com> (raw)
In-Reply-To: <20110519101056.ca8e86f6.kamezawa.hiroyu@jp.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

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 <yinghan@google.com> 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.

--Ying

>
> ==
> The value for counter base should be initialized. If not,
> this returns wrong value.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
>  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++) {
>
>

[-- Attachment #2: Type: text/html, Size: 2073 bytes --]

  reply	other threads:[~2011-05-19  2:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19  0:55 [PATCH V2 1/2] memcg: rename mem_cgroup_zone_nr_pages() to mem_cgroup_zone_nr_lru_pages() Ying Han
2011-05-19  0:55 ` [PATCH V2 2/2] memcg: add memory.numastat api for numa statistics Ying Han
2011-05-19  1:10   ` [PATCH][BUGFIX] memcg: fix a routine for counting pages in node (Re: " KAMEZAWA Hiroyuki
2011-05-19  2:55     ` Ying Han [this message]
2011-05-19  3:53       ` Ying Han
2011-05-19  6:22   ` Daisuke Nishimura
2011-05-19 15:23     ` Ying Han
2011-05-19  8:01   ` Balbir Singh
2011-05-19 15:36     ` Ying Han
2011-05-19  8:26 ` [PATCH V2 1/2] memcg: rename mem_cgroup_zone_nr_pages() to mem_cgroup_zone_nr_lru_pages() Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimbbCBd0w5MpMCkTixTtukKGnyQCA@mail.gmail.com \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=cl@linux.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mel@csn.ul.ie \
    --cc=mhocko@suse.cz \
    --cc=minchan.kim@gmail.com \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=riel@redhat.com \
    --cc=tj@kernel.org \
    --cc=xemul@openvz.org \
    --cc=zhu.yanhai@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).