aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2008-10-18 23:28:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 11:52:38 -0400
commitb7abea9630bc8ffc663a751e46680db25c4cdf8d (patch)
treeb37d5ba073ccea31328812c74598872d49a85735 /mm/memcontrol.c
parent073e587ec2cc377867e53d8b8959738a8e16cff6 (diff)
memcg: make page->mapping NULL before uncharge
This patch tries to make page->mapping to be NULL before mem_cgroup_uncharge_cache_page() is called. "page->mapping == NULL" is a good check for "whether the page is still radix-tree or not". This patch also adds BUG_ON() to mem_cgroup_uncharge_cache_page(); Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Balbir Singh <balbir@linux.vnet.ibm.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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e93a4db93fbe..6f8b5b3b38b2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -734,6 +734,7 @@ void mem_cgroup_uncharge_page(struct page *page)
734void mem_cgroup_uncharge_cache_page(struct page *page) 734void mem_cgroup_uncharge_cache_page(struct page *page)
735{ 735{
736 VM_BUG_ON(page_mapped(page)); 736 VM_BUG_ON(page_mapped(page));
737 VM_BUG_ON(page->mapping);
737 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE); 738 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE);
738} 739}
739 740