Skip to content

Commit 40f23a2

Browse files
Johannes Weinertorvalds
authored andcommitted
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>
1 parent 7a0524c commit 40f23a2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎mm/memcontrol.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,8 +3061,7 @@ void mem_cgroup_uncharge_page(struct page *page)
30613061
/* early check. */
30623062
if (page_mapped(page))
30633063
return;
3064-
if (page->mapping && !PageAnon(page))
3065-
return;
3064+
VM_BUG_ON(page->mapping && !PageAnon(page));
30663065
__mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED);
30673066
}
30683067

0 commit comments

Comments
 (0)