Commit 3a58a2a6c879b2e47daafd6e641661c50ac9da5a

Authored by Yinghai Lu
Committed by Ingo Molnar
1 parent cfb0e53b05

x86: introduce init_memory_mapping for 32bit #3

move kva related early backto initmem_init for numa32

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 3 changed files with 6 additions and 27 deletions Side-by-side Diff

arch/x86/mm/discontig_32.c
... ... @@ -200,7 +200,7 @@
200 200 return allocation;
201 201 }
202 202  
203   -void __init remap_numa_kva(void)
  203 +static void __init remap_numa_kva(void)
204 204 {
205 205 void *vaddr;
206 206 unsigned long pfn;
207 207  
... ... @@ -373,12 +373,16 @@
373 373  
374 374 allocate_pgdat(nid);
375 375 }
  376 + remap_numa_kva();
  377 +
376 378 printk(KERN_DEBUG "High memory starts at vaddr %08lx\n",
377 379 (ulong) pfn_to_kaddr(highstart_pfn));
378 380 for_each_online_node(nid)
379 381 propagate_e820_map_node(nid);
380 382  
381   - memset(NODE_DATA(0), 0, sizeof(struct pglist_data));
  383 + for_each_online_node(nid)
  384 + memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
  385 +
382 386 NODE_DATA(0)->bdata = &node0_bdata;
383 387 setup_bootmem_allocator();
384 388 }
arch/x86/mm/init_32.c
... ... @@ -449,7 +449,6 @@
449 449  
450 450 paravirt_pagetable_setup_start(pgd_base);
451 451  
452   - remap_numa_kva();
453 452 /*
454 453 * Fixed mappings, only the page table structure has to be
455 454 * created - mappings will be set by set_fixmap():
... ... @@ -724,24 +723,6 @@
724 723 after_init_bootmem = 1;
725 724 }
726 725  
727   -/*
728   - * The node 0 pgdat is initialized before all of these because
729   - * it's needed for bootmem. node>0 pgdats have their virtual
730   - * space allocated before the pagetables are in place to access
731   - * them, so they can't be cleared then.
732   - *
733   - * This should all compile down to nothing when NUMA is off.
734   - */
735   -static void __init remapped_pgdat_init(void)
736   -{
737   - int nid;
738   -
739   - for_each_online_node(nid) {
740   - if (nid != 0)
741   - memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
742   - }
743   -}
744   -
745 726 static void __init find_early_table_space(unsigned long end)
746 727 {
747 728 unsigned long puds, pmds, tables, start;
... ... @@ -831,7 +812,6 @@
831 812 /*
832 813 * NOTE: at this point the bootmem allocator is fully available.
833 814 */
834   - remapped_pgdat_init();
835 815 sparse_init();
836 816 zone_sizes_init();
837 817  
include/asm-x86/numa_32.h
... ... @@ -5,12 +5,7 @@
5 5 extern void numa_remove_cpu(int cpu);
6 6  
7 7 #ifdef CONFIG_NUMA
8   -extern void __init remap_numa_kva(void);
9 8 extern void set_highmem_pages_init(void);
10   -#else
11   -static inline void remap_numa_kva(void)
12   -{
13   -}
14 9 #endif
15 10  
16 11 #endif /* _ASM_X86_32_NUMA_H */