x86, mm: Make init_mem_mapping be able to be called several times
PATCH v4 21/22 x86, mm: Make init_mem_mapping be able to be called several times
Prepare to put page table on local nodes.
Move calling of init_mem_mapping to early_initmem_init.
Rework alloc_low_pages to alloc page table in following order:
BRK, local node, low range
update: remove two lines in changelog about xen.
Signed-off-by Yinghai Lu <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Jacob Shin <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
--- arch/x86/include/asm/pgtable.h | 2 +- arch/x86/kernel/setup.c | 1 - arch/x86/mm/init.c | 88 ++++++++++++++++++++++++++---------------- arch/x86/mm/numa.c | 24 ++++++++++++ 4 files changed, 79 insertions(+), 36 deletions(-)
arch/x86/include/asm/pgtable.h +1 -1
@@ -621,7 +621,7 @@ static inline int pgd_none(pgd_t pgd)#ifndef __ASSEMBLY__extern int direct_gbpages; -void init_mem_mapping (void ); +void init_mem_mapping (unsigned long begin,unsigned long end);void early_alloc_pgt_buf (void );/* local pte updates need not use xchg for locking */
arch/x86/kernel/setup.c +0 -1
@@ -1105,7 +1105,6 @@ void __init setup_arch(char **cmdline_p)acpi_boot_table_init ();early_acpi_boot_init ();early_initmem_init (); -init_mem_mapping (); memblock.current_limit =get_max_mapped ();early_trap_pf_init ();
arch/x86/mm/init.c +54 -34
142 lines not on this page · raw message
arch/x86/mm/numa.c +24 -0
@@ -17,8 +17,10 @@#include <asm/dma.h> #include <asm/acpi.h> #include <asm/amd_nb.h> +#include <asm/tlbflush.h> #include "numa_internal.h" +#include "mm_internal.h" int __initdata numa_off;nodemask_t numa_nodes_parsed__initdata ;
@@ -668,9 +670,31 @@ static void __init early_x86_numa_init(void)numa_init (dummy_numa_init); } +#ifdef CONFIG_X86_64 +static void __init early_x86_numa_init_mapping (void ) +{ +init_mem_mapping (0 , max_pfn <<PAGE_SHIFT ); +if (max_pfn > max_low_pfn) + max_low_pfn = max_pfn; +} +#else +static void __init early_x86_numa_init_mapping (void ) +{ +init_mem_mapping (0 , max_low_pfn <<PAGE_SHIFT ); +early_ioremap_page_table_range_init (); +} +#endif +void __init early_initmem_init (void ) {early_x86_numa_init (); + +early_x86_numa_init_mapping (); + +load_cr3 (swapper_pg_dir); +__flush_tlb_all (); + +early_memtest (0 , max_pfn_mapped<<PAGE_SHIFT ); }void __init x86_numa_init (void )
Signature · 1 line
1.8.1.4