From: Ingo Molnar Date: Wed, 17 Oct 2007 16:04:34 +0000 (+0200) Subject: x86: prepare page allocator for high allocations on PAGEALLOC=y X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1e3e19723ecd58149388f3eecbd3285825f64f3b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git x86: prepare page allocator for high allocations on PAGEALLOC=y To preserve the DMA pool in CONFIG_DEBUG_PAGEALLOC=y kernels, we'll allocate pagetables from above the 16MB DMA limit, so we'll have to set up boot pagetables to cover 16MB more RAM (worst-case). Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 9150ca9b5f80..0fa8a972a679 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -51,6 +51,15 @@ */ LOW_PAGES = 1<<(32-PAGE_SHIFT_asm) +/* + * To preserve the DMA pool in PAGEALLOC kernels, we'll allocate + * pagetables from above the 16MB DMA limit, so we'll have to set + * up pagetables 16MB more (worst-case): + */ +#ifdef CONFIG_DEBUG_PAGEALLOC +LOW_PAGES = LOW_PAGES + 0x1000000 +#endif + #if PTRS_PER_PMD > 1 PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD #else