diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2011-03-23 19:42:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 22:46:28 -0400 |
commit | 6b3ae58efca06623c197fd6d91ded4aa3a8fe039 (patch) | |
tree | 6460e4e1ce206d391b862a3d398a9e22e33ecb3c /mm/memcontrol.c | |
parent | 5564e88ba6fd2f6dcd83a592771810cd84b5ae80 (diff) |
memcg: remove direct page_cgroup-to-page pointer
In struct page_cgroup, we have a full word for flags but only a few are
reserved. Use the remaining upper bits to encode, depending on
configuration, the node or the section, to enable page_cgroup-to-page
lookups without a direct pointer.
This saves a full word for every page in a system with memory cgroups
enabled.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e286e1603e4f..660dfc27d971 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1080,7 +1080,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
1080 | if (unlikely(!PageCgroupUsed(pc))) | 1080 | if (unlikely(!PageCgroupUsed(pc))) |
1081 | continue; | 1081 | continue; |
1082 | 1082 | ||
1083 | page = pc->page; | 1083 | page = lookup_cgroup_page(pc); |
1084 | 1084 | ||
1085 | if (unlikely(!PageLRU(page))) | 1085 | if (unlikely(!PageLRU(page))) |
1086 | continue; | 1086 | continue; |
@@ -3344,7 +3344,7 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *mem, | |||
3344 | } | 3344 | } |
3345 | spin_unlock_irqrestore(&zone->lru_lock, flags); | 3345 | spin_unlock_irqrestore(&zone->lru_lock, flags); |
3346 | 3346 | ||
3347 | page = pc->page; | 3347 | page = lookup_cgroup_page(pc); |
3348 | 3348 | ||
3349 | ret = mem_cgroup_move_parent(page, pc, mem, GFP_KERNEL); | 3349 | ret = mem_cgroup_move_parent(page, pc, mem, GFP_KERNEL); |
3350 | if (ret == -ENOMEM) | 3350 | if (ret == -ENOMEM) |