aboutsummaryrefslogtreecommitdiff
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2011-01-13 15:46:34 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 17:32:39 -0800
commit8dd60a3a65c1b057bf0031d28436d3447a3c545b (patch)
tree19040d799dbf846191c8855450c662014ecec722 /mm/page_alloc.c
parenta5b338f2b0b1ff73ae20c66ab831201549eaec01 (diff)
thp: clear compound mapping
Clear compound mapping for anonymous compound pages like it already happens for regular anonymous pages. But crash if mapping is set for any tail page, also the PageAnon check is meaningless for tail pages. This check only makes sense for the head page, for tail page it can only hide bugs and we definitely don't want to hide bugs. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2a67c3bd403..8be81422d4b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -651,13 +651,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
trace_mm_page_free_direct(page, order);
kmemcheck_free_shadow(page, order);
- for (i = 0; i < (1 << order); i++) {
- struct page *pg = page + i;
-
- if (PageAnon(pg))
- pg->mapping = NULL;
- bad += free_pages_check(pg);
- }
+ if (PageAnon(page))
+ page->mapping = NULL;
+ for (i = 0; i < (1 << order); i++)
+ bad += free_pages_check(page + i);
if (bad)
return false;