diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2009-01-07 18:08:19 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 08:31:08 -0800 |
commit | a3d8e0549d913e30968fa02e505dfe02c0a23e0d (patch) | |
tree | e4d3df33666a18614289ae7bc76c27ad7950eb73 /mm/memcontrol.c | |
parent | 14797e2363c2b2f1ce139fd1c5a215e4e05aa1d9 (diff) | |
download | blackbird-op-linux-a3d8e0549d913e30968fa02e505dfe02c0a23e0d.tar.gz blackbird-op-linux-a3d8e0549d913e30968fa02e505dfe02c0a23e0d.zip |
memcg: add mem_cgroup_zone_nr_pages()
Introduce mem_cgroup_zone_nr_pages(). It is called by zone_nr_pages()
helper function.
This patch doesn't have any behavior change.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6611328460e9..313247e6c503 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -186,7 +186,6 @@ pcg_default_flags[NR_CHARGE_TYPE] = { 0, /* FORCE */ }; - /* for encoding cft->private value on file */ #define _MEM (0) #define _MEMSWAP (1) @@ -448,6 +447,17 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) return 0; } +unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, + struct zone *zone, + enum lru_list lru) +{ + int nid = zone->zone_pgdat->node_id; + int zid = zone_idx(zone); + struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(memcg, nid, zid); + + return MEM_CGROUP_ZSTAT(mz, lru); +} + unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, struct list_head *dst, unsigned long *scanned, int order, |