diff options
author | Michal Hocko <mhocko@suse.cz> | 2011-03-23 16:42:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 19:46:33 -0700 |
commit | 6cfddb261555dd0c0529a5fb7cf8bc5b85ad95a5 (patch) | |
tree | d6c966290c7a8224171c850098767a6fbfa5747b /mm/page_cgroup.c | |
parent | dde79e005a769d800166687c9e00d50d93e411ff (diff) | |
download | blackbird-op-linux-6cfddb261555dd0c0529a5fb7cf8bc5b85ad95a5.tar.gz blackbird-op-linux-6cfddb261555dd0c0529a5fb7cf8bc5b85ad95a5.zip |
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>
Diffstat (limited to 'mm/page_cgroup.c')
-rw-r--r-- | mm/page_cgroup.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 8e7577cdf5e4..a12cc3fa9859 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -153,11 +153,11 @@ static void free_page_cgroup(void *addr) vfree(addr); } else { struct page *page = virt_to_page(addr); - if (!PageReserved(page)) { /* Is bootmem ? */ - size_t table_size = - sizeof(struct page_cgroup) * PAGES_PER_SECTION; - free_pages_exact(addr, table_size); - } + size_t table_size = + sizeof(struct page_cgroup) * PAGES_PER_SECTION; + + BUG_ON(PageReserved(page)); + free_pages_exact(addr, table_size); } } #endif |