aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/hugetlbpage.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/hugetlbpage.c')
-rw-r--r--arch/x86/mm/hugetlbpage.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 8b977ebf9388..bca0aa3a003f 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -178,4 +178,15 @@ static __init int setup_hugepagesz(char *opt)
178 return 1; 178 return 1;
179} 179}
180__setup("hugepagesz=", setup_hugepagesz); 180__setup("hugepagesz=", setup_hugepagesz);
181
182#ifdef CONFIG_CMA
183static __init int gigantic_pages_init(void)
184{
185 /* With CMA we can allocate gigantic pages at runtime */
186 if (cpu_has_gbpages && !size_to_hstate(1UL << PUD_SHIFT))
187 hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
188 return 0;
189}
190arch_initcall(gigantic_pages_init);
191#endif
181#endif 192#endif