From: KAMEZAWA Hiroyuki Date: Thu, 7 Feb 2008 08:14:30 +0000 (-0800) Subject: per-zone and reclaim enhancements for memory controller: nid/zid helper function... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0149530d0bb356c933a09f3c8103ea02f452d8a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Cc: "Eric W. Biederman" Cc: Balbir Singh Cc: David Rientjes Cc: Herbert Poetzl Cc: Kirill Korotaev Cc: Nick Piggin Cc: Paul Menage Cc: Pavel Emelianov Cc: Peter Zijlstra Cc: Vaidyanathan Srinivasan Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 { #define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */ #define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */ +static inline int page_cgroup_nid(struct page_cgroup *pc) +{ + return page_to_nid(pc->page); +} + +static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc) +{ + return page_zonenum(pc->page); +} + enum { MEM_CGROUP_TYPE_UNSPEC = 0, MEM_CGROUP_TYPE_MAPPED,