Commit 40f23a21a8501c1b2c65c50c19b516488ac31313
Committed by
Linus Torvalds
1 parent
7a0524cfc8
Exists in
master
and in
6 other branches
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>
Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff
mm/memcontrol.c
... | ... | @@ -3061,8 +3061,7 @@ |
3061 | 3061 | /* early check. */ |
3062 | 3062 | if (page_mapped(page)) |
3063 | 3063 | return; |
3064 | - if (page->mapping && !PageAnon(page)) | |
3065 | - return; | |
3064 | + VM_BUG_ON(page->mapping && !PageAnon(page)); | |
3066 | 3065 | __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED); |
3067 | 3066 | } |
3068 | 3067 |