diff options
author | Steve Capper <steve.capper@linaro.org> | 2013-05-07 09:46:03 -0400 |
---|---|---|
committer | Steve Capper <steve.capper@linaro.org> | 2013-06-14 04:40:28 -0400 |
commit | dfa5e237e935bc6712c9ac2f52a5469a0df85bcf (patch) | |
tree | 277e0e8f1817893d115d901d1737461e86f255b9 | |
parent | 53313b2c9130a54dece8595c5a77fd787f340433 (diff) |
mm: thp: Correct the HPAGE_PMD_ORDER check.
All Transparent Huge Pages are allocated by the buddy allocator.
A compile time check is in place that fails when the order of a
transparent huge page is too large to be allocated by the buddy
allocator. Unfortunately that compile time check passes when:
HPAGE_PMD_ORDER == MAX_ORDER
( which is incorrect as the buddy allocator can only allocate
memory of order strictly less than MAX_ORDER. )
This patch updates the compile time check to fail in the above
case.
Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | include/linux/huge_mm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 528454c2caa9..26ee56c80dc7 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -123,7 +123,7 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma, | |||
123 | } while (0) | 123 | } while (0) |
124 | extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, | 124 | extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, |
125 | pmd_t *pmd); | 125 | pmd_t *pmd); |
126 | #if HPAGE_PMD_ORDER > MAX_ORDER | 126 | #if HPAGE_PMD_ORDER >= MAX_ORDER |
127 | #error "hugepages can't be allocated by the buddy allocator" | 127 | #error "hugepages can't be allocated by the buddy allocator" |
128 | #endif | 128 | #endif |
129 | extern int hugepage_madvise(struct vm_area_struct *vma, | 129 | extern int hugepage_madvise(struct vm_area_struct *vma, |