aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Weiner <jweiner@redhat.com>2012-01-12 20:18:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 23:13:06 -0500
commit40f23a21a8501c1b2c65c50c19b516488ac31313 (patch)
tree4e70dbd9e7cc1dda350156bf05786ede7dbf8256
parent7a0524cfc8f9f585471a31b1282a9ce4a1a7d444 (diff)
mm: memcg: remove unneeded checks from uncharge_page()
mem_cgroup_uncharge_page() is only called on either freshly allocated pages without page->mapping or on rmapped PageAnon() pages. There is no need to check for a page->mapping that is not an anon_vma. Signed-off-by: Johannes Weiner <jweiner@redhat.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Balbir Singh <bsingharora@gmail.com> Cc: David Rientjes <rientjes@google.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/memcontrol.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2450d89486d4..71a9774e6ead 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3061,8 +3061,7 @@ void mem_cgroup_uncharge_page(struct page *page)
3061 /* early check. */ 3061 /* early check. */
3062 if (page_mapped(page)) 3062 if (page_mapped(page))
3063 return; 3063 return;
3064 if (page->mapping && !PageAnon(page)) 3064 VM_BUG_ON(page->mapping && !PageAnon(page));
3065 return;
3066 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED); 3065 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED);
3067} 3066}
3068 3067