aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2011-01-13 18:46:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 20:32:42 -0500
commit8a07651ee8cdaa9e27cb4ae372aed347533770f5 (patch)
tree07a442e66c3f608e174edd3b8a2fd154f4219380 /mm/memory.c
parent71e3aac0724ffe8918992d76acfe3aad7d8724a5 (diff)
thp: transparent hugepage core fixlet
If you configure THP in addition to HUGETLB_PAGE on x86_32 without PAE, the p?d-folding works out that munlock_vma_pages_range() can crash to follow_page()'s pud_huge() BUG_ON(flags & FOLL_GET): it needs the same VM_HUGETLB check already there on the pmd_huge() line. Conveniently, openSUSE provides a "blogd" which tests this out at startup! Signed-off-by: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index c50a195041ec..840ce9d98f8b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1288,7 +1288,7 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
1288 pud = pud_offset(pgd, address); 1288 pud = pud_offset(pgd, address);
1289 if (pud_none(*pud)) 1289 if (pud_none(*pud))
1290 goto no_page_table; 1290 goto no_page_table;
1291 if (pud_huge(*pud)) { 1291 if (pud_huge(*pud) && vma->vm_flags & VM_HUGETLB) {
1292 BUG_ON(flags & FOLL_GET); 1292 BUG_ON(flags & FOLL_GET);
1293 page = follow_huge_pud(mm, address, pud, flags & FOLL_WRITE); 1293 page = follow_huge_pud(mm, address, pud, flags & FOLL_WRITE);
1294 goto out; 1294 goto out;