diff options
Diffstat (limited to 'arch/x86/mm/pageattr_32.c')
-rw-r--r-- | arch/x86/mm/pageattr_32.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index 9cf2fea54eb5..dd49b16b3a0e 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c | |||
@@ -61,13 +61,17 @@ static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) | |||
61 | static int split_large_page(pte_t *kpte, unsigned long address) | 61 | static int split_large_page(pte_t *kpte, unsigned long address) |
62 | { | 62 | { |
63 | pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); | 63 | pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); |
64 | gfp_t gfp_flags = GFP_KERNEL; | ||
64 | unsigned long flags; | 65 | unsigned long flags; |
65 | unsigned long addr; | 66 | unsigned long addr; |
66 | pte_t *pbase, *tmp; | 67 | pte_t *pbase, *tmp; |
67 | struct page *base; | 68 | struct page *base; |
68 | int i, level; | 69 | int i, level; |
69 | 70 | ||
70 | base = alloc_pages(GFP_KERNEL, 0); | 71 | #ifdef CONFIG_DEBUG_PAGEALLOC |
72 | gfp_flags = GFP_ATOMIC; | ||
73 | #endif | ||
74 | base = alloc_pages(gfp_flags, 0); | ||
71 | if (!base) | 75 | if (!base) |
72 | return -ENOMEM; | 76 | return -ENOMEM; |
73 | 77 | ||
@@ -219,6 +223,12 @@ void kernel_map_pages(struct page *page, int numpages, int enable) | |||
219 | } | 223 | } |
220 | 224 | ||
221 | /* | 225 | /* |
226 | * If page allocator is not up yet then do not call c_p_a(): | ||
227 | */ | ||
228 | if (!debug_pagealloc_enabled) | ||
229 | return; | ||
230 | |||
231 | /* | ||
222 | * the return value is ignored - the calls cannot fail, | 232 | * the return value is ignored - the calls cannot fail, |
223 | * large pages are disabled at boot time. | 233 | * large pages are disabled at boot time. |
224 | */ | 234 | */ |