Commit 6cfddb261555dd0c0529a5fb7cf8bc5b85ad95a5
Committed by
Linus Torvalds
1 parent
dde79e005a
Exists in
master
and in
20 other branches
memcg: page_cgroup array is never stored on reserved pages
KAMEZAWA Hiroyuki noted that free_pages_cgroup doesn't have to check for PageReserved because we never store the array on reserved pages (neither alloc_pages_exact nor vmalloc use those pages). So we can replace the check by a BUG_ON. Signed-off-by: Michal Hocko <mhocko@suse.cz> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
mm/page_cgroup.c
... | ... | @@ -153,11 +153,11 @@ |
153 | 153 | vfree(addr); |
154 | 154 | } else { |
155 | 155 | struct page *page = virt_to_page(addr); |
156 | - if (!PageReserved(page)) { /* Is bootmem ? */ | |
157 | - size_t table_size = | |
158 | - sizeof(struct page_cgroup) * PAGES_PER_SECTION; | |
159 | - free_pages_exact(addr, table_size); | |
160 | - } | |
156 | + size_t table_size = | |
157 | + sizeof(struct page_cgroup) * PAGES_PER_SECTION; | |
158 | + | |
159 | + BUG_ON(PageReserved(page)); | |
160 | + free_pages_exact(addr, table_size); | |
161 | 161 | } |
162 | 162 | } |
163 | 163 | #endif |