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 <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Balbir Singh <[email protected]> Cc: David Rientjes <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7a0524c commit 40f23a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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)