diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:46:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:39 -0500 |
commit | 8dd60a3a65c1b057bf0031d28436d3447a3c545b (patch) | |
tree | 19040d799dbf846191c8855450c662014ecec722 /mm | |
parent | a5b338f2b0b1ff73ae20c66ab831201549eaec01 (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')
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2a67c3bd403a..8be81422d4bd 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) | |||
651 | trace_mm_page_free_direct(page, order); | 651 | trace_mm_page_free_direct(page, order); |
652 | kmemcheck_free_shadow(page, order); | 652 | kmemcheck_free_shadow(page, order); |
653 | 653 | ||
654 | for (i = 0; i < (1 << order); i++) { | 654 | if (PageAnon(page)) |
655 | struct page *pg = page + i; | 655 | page->mapping = NULL; |
656 | 656 | for (i = 0; i < (1 << order); i++) | |
657 | if (PageAnon(pg)) | 657 | bad += free_pages_check(page + i); |
658 | pg->mapping = NULL; | ||
659 | bad += free_pages_check(pg); | ||
660 | } | ||
661 | if (bad) | 658 | if (bad) |
662 | return false; | 659 | return false; |
663 | 660 | ||