diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-02-10 04:20:20 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-12 12:41:59 -0500 |
commit | 08677214e318297f228237be0042aac754f48f1d (patch) | |
tree | 6d03424f7e287fcf66136b44512328afb1aeee49 /arch/x86/mm | |
parent | c252a5bb1f57afb1e336d68085217727ca7b2134 (diff) |
x86: Make 64 bit use early_res instead of bootmem before slab
Finally we can use early_res to replace bootmem for x86_64 now.
Still can use CONFIG_NO_BOOTMEM to enable it or not.
-v2: fix 32bit compiling about MAX_DMA32_PFN
-v3: folded bug fix from LKML message below
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4B747239.4070907@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init_64.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index a15abaae5ba4..53158b7e5d46 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -572,6 +572,7 @@ kernel_physical_mapping_init(unsigned long start, | |||
572 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | 572 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, |
573 | int acpi, int k8) | 573 | int acpi, int k8) |
574 | { | 574 | { |
575 | #ifndef CONFIG_NO_BOOTMEM | ||
575 | unsigned long bootmap_size, bootmap; | 576 | unsigned long bootmap_size, bootmap; |
576 | 577 | ||
577 | bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; | 578 | bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; |
@@ -585,6 +586,9 @@ void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | |||
585 | 0, end_pfn); | 586 | 0, end_pfn); |
586 | e820_register_active_regions(0, start_pfn, end_pfn); | 587 | e820_register_active_regions(0, start_pfn, end_pfn); |
587 | free_bootmem_with_active_regions(0, end_pfn); | 588 | free_bootmem_with_active_regions(0, end_pfn); |
589 | #else | ||
590 | e820_register_active_regions(0, start_pfn, end_pfn); | ||
591 | #endif | ||
588 | } | 592 | } |
589 | #endif | 593 | #endif |
590 | 594 | ||
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 02f13cb99bc2..a20e17059afd 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -198,11 +198,13 @@ static void * __init early_node_mem(int nodeid, unsigned long start, | |||
198 | void __init | 198 | void __init |
199 | setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) | 199 | setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) |
200 | { | 200 | { |
201 | unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size; | 201 | unsigned long start_pfn, last_pfn, nodedata_phys; |
202 | const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE); | 202 | const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE); |
203 | unsigned long bootmap_start, nodedata_phys; | ||
204 | void *bootmap; | ||
205 | int nid; | 203 | int nid; |
204 | #ifndef CONFIG_NO_BOOTMEM | ||
205 | unsigned long bootmap_start, bootmap_pages, bootmap_size; | ||
206 | void *bootmap; | ||
207 | #endif | ||
206 | 208 | ||
207 | if (!end) | 209 | if (!end) |
208 | return; | 210 | return; |
@@ -216,7 +218,7 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) | |||
216 | 218 | ||
217 | start = roundup(start, ZONE_ALIGN); | 219 | start = roundup(start, ZONE_ALIGN); |
218 | 220 | ||
219 | printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid, | 221 | printk(KERN_INFO "Initmem setup node %d %016lx-%016lx\n", nodeid, |
220 | start, end); | 222 | start, end); |
221 | 223 | ||
222 | start_pfn = start >> PAGE_SHIFT; | 224 | start_pfn = start >> PAGE_SHIFT; |
@@ -235,10 +237,13 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) | |||
235 | printk(KERN_INFO " NODE_DATA(%d) on node %d\n", nodeid, nid); | 237 | printk(KERN_INFO " NODE_DATA(%d) on node %d\n", nodeid, nid); |
236 | 238 | ||
237 | memset(NODE_DATA(nodeid), 0, sizeof(pg_data_t)); | 239 | memset(NODE_DATA(nodeid), 0, sizeof(pg_data_t)); |
238 | NODE_DATA(nodeid)->bdata = &bootmem_node_data[nodeid]; | 240 | NODE_DATA(nodeid)->node_id = nodeid; |
239 | NODE_DATA(nodeid)->node_start_pfn = start_pfn; | 241 | NODE_DATA(nodeid)->node_start_pfn = start_pfn; |
240 | NODE_DATA(nodeid)->node_spanned_pages = last_pfn - start_pfn; | 242 | NODE_DATA(nodeid)->node_spanned_pages = last_pfn - start_pfn; |
241 | 243 | ||
244 | #ifndef CONFIG_NO_BOOTMEM | ||
245 | NODE_DATA(nodeid)->bdata = &bootmem_node_data[nodeid]; | ||
246 | |||
242 | /* | 247 | /* |
243 | * Find a place for the bootmem map | 248 | * Find a place for the bootmem map |
244 | * nodedata_phys could be on other nodes by alloc_bootmem, | 249 | * nodedata_phys could be on other nodes by alloc_bootmem, |
@@ -275,6 +280,7 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) | |||
275 | printk(KERN_INFO " bootmap(%d) on node %d\n", nodeid, nid); | 280 | printk(KERN_INFO " bootmap(%d) on node %d\n", nodeid, nid); |
276 | 281 | ||
277 | free_bootmem_with_active_regions(nodeid, end); | 282 | free_bootmem_with_active_regions(nodeid, end); |
283 | #endif | ||
278 | 284 | ||
279 | node_set_online(nodeid); | 285 | node_set_online(nodeid); |
280 | } | 286 | } |
@@ -733,6 +739,10 @@ unsigned long __init numa_free_all_bootmem(void) | |||
733 | for_each_online_node(i) | 739 | for_each_online_node(i) |
734 | pages += free_all_bootmem_node(NODE_DATA(i)); | 740 | pages += free_all_bootmem_node(NODE_DATA(i)); |
735 | 741 | ||
742 | #ifdef CONFIG_NO_BOOTMEM | ||
743 | pages += free_all_memory_core_early(MAX_NUMNODES); | ||
744 | #endif | ||
745 | |||
736 | return pages; | 746 | return pages; |
737 | } | 747 | } |
738 | 748 | ||