aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2008-02-07 03:14:30 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:21 -0500
commitc0149530d0bb356c933a09f3c8103ea02f452d8a (patch)
tree84f378ab7209bac903d49fe4e0807537c609697c /mm/memcontrol.c
parent91a45470f7ddc322073752e711a2e8dcbc339e6f (diff)
per-zone and reclaim enhancements for memory controller: nid/zid helper function for cgroup
Add macro to get node_id and zone_id of page_cgroup. Will be used in per-zone-xxx patches and others. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: David Rientjes <rientjes@google.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Kirill Korotaev <dev@sw.ru> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Paul Menage <menage@google.com> Cc: Pavel Emelianov <xemul@openvz.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Cc: Rik van Riel <riel@redhat.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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 14cb6142ec4c..422f779a5b21 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -135,6 +135,16 @@ struct page_cgroup {
135#define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */ 135#define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */
136#define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */ 136#define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */
137 137
138static inline int page_cgroup_nid(struct page_cgroup *pc)
139{
140 return page_to_nid(pc->page);
141}
142
143static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc)
144{
145 return page_zonenum(pc->page);
146}
147
138enum { 148enum {
139 MEM_CGROUP_TYPE_UNSPEC = 0, 149 MEM_CGROUP_TYPE_UNSPEC = 0,
140 MEM_CGROUP_TYPE_MAPPED, 150 MEM_CGROUP_TYPE_MAPPED,