[PATCH] x86: change propagate_e820_map back to find_max_pfn -32bit -v2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Monday, June 2, 2008 - 7:16 pm

we don't need to call memory_present that early.
numa dist and sparse will call memory_present later
and even fail, it will call memory_present for all range.

v2: add memory_present calling for sparse and non numa

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/kernel/e820_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/e820_32.c
+++ linux-2.6/arch/x86/kernel/e820_32.c
@@ -210,7 +210,7 @@ void __init init_iomem_resources(struct 
 /*
  * Find the highest page frame number we have available
  */
-void __init propagate_e820_map(void)
+void __init find_max_pfn(void)
 {
 	int i;
 
@@ -227,7 +227,6 @@ void __init propagate_e820_map(void)
 			continue;
 		if (end > max_pfn)
 			max_pfn = end;
-		memory_present(0, start, end);
 	}
 }
 
@@ -361,7 +360,7 @@ static int __init parse_memmap(char *arg
 		 * size before original memory map is
 		 * reset.
 		 */
-		propagate_e820_map();
+		find_max_pfn();
 		saved_max_pfn = max_pfn;
 #endif
 		e820.nr_map = 0;
Index: linux-2.6/arch/x86/kernel/setup_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_32.c
+++ linux-2.6/arch/x86/kernel/setup_32.c
@@ -378,11 +378,13 @@ static unsigned long __init setup_memory
 	if (max_pfn > max_low_pfn) {
 		highstart_pfn = max_low_pfn;
 	}
+	memory_present(0, 0, highend_pfn);
 	printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
 		pages_to_mb(highend_pfn - highstart_pfn));
 	num_physpages = highend_pfn;
 	high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
 #else
+	memory_present(0, 0, max_low_pfn);
 	num_physpages = max_low_pfn;
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
 #endif
@@ -742,10 +744,10 @@ void __init setup_arch(char **cmdline_p)
 		efi_init();
 
 	/* update e820 for memory not covered by WB MTRRs */
-	propagate_e820_map();
+	find_max_pfn();
 	mtrr_bp_init();
 	if (mtrr_trim_uncached_memory(max_pfn))
-		propagate_e820_map();
+		find_max_pfn();
 
 	max_low_pfn = setup_memory();
 
Index: linux-2.6/arch/x86/mm/discontig_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/discontig_32.c
+++ linux-2.6/arch/x86/mm/discontig_32.c
@@ -120,7 +120,7 @@ int __init get_memcfg_numa_flat(void)
 	printk("NUMA - single node, flat memory mode\n");
 
 	/* Run the memory configuration and find the top of memory. */
-	propagate_e820_map();
+	find_max_pfn();
 	node_start_pfn[0] = 0;
 	node_end_pfn[0] = max_pfn;
 	memory_present(0, 0, max_pfn);
Index: linux-2.6/include/asm-x86/e820_32.h
===================================================================
--- linux-2.6.orig/include/asm-x86/e820_32.h
+++ linux-2.6/include/asm-x86/e820_32.h
@@ -21,7 +21,7 @@
 extern void setup_memory_map(void);
 extern void finish_e820_parsing(void);
 
-extern void propagate_e820_map(void);
+extern void find_max_pfn(void);
 extern void register_bootmem_low_pages(unsigned long max_low_pfn);
 extern void limit_regions(unsigned long long size);
 extern void init_iomem_resources(struct resource *code_resource,
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: make e820.c to have common functions, Yinghai Lu, (Sun May 11, 12:30 am)
Re: [PATCH] x86: make e820.c to have common functions, Ingo Molnar, (Tue May 13, 6:05 am)
Re: [PATCH] x86: make e820.c to have common functions, Yinghai Lu, (Tue May 13, 10:35 am)
[PATCH] x86: extend e820 ealy_res support 32bit, Yinghai Lu, (Sun May 18, 1:18 am)
[PATCH] x86: move e820_mark_nosave_regions to e820.c, Yinghai Lu, (Tue May 20, 8:10 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix, Jeremy Fitzhardinge, (Thu May 22, 3:12 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Fri May 23, 4:32 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Fri May 23, 4:38 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Sat May 24, 1:54 am)
[PATCH] xen: boot via i386_start_kernel to get early reser ..., Jeremy Fitzhardinge, (Sat May 24, 2:49 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Thomas Gleixner, (Tue May 27, 8:44 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 1:37 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Thomas Gleixner, (Tue May 27, 1:58 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 2:06 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 2:22 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 2:47 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Wed May 28, 3:01 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Wed May 28, 2:24 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Thu May 29, 6:37 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, H. Peter Anvin, (Thu May 29, 11:58 am)
[PATCH] x86: 32bit numa srat fix early_ioremap leak, Yinghai Lu, (Thu May 29, 4:25 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Fri May 30, 8:50 am)
[PATCH] x86: 32bit numa increase max_elements to 1024, Yinghai Lu, (Sat May 31, 10:51 pm)
[PATCH] x86: set node_remap_size[0] in fallback path, Yinghai Lu, (Sat May 31, 10:53 pm)
[PATCH] x86: numa_32 print out debug info all kva, Yinghai Lu, (Sat May 31, 10:56 pm)
[PATCH] x86: cleanup max_pfn_mapped usage - 32bit, Yinghai Lu, (Sun Jun 1, 11:53 pm)
[PATCH] x86: cleanup max_pfn_mapped usage - 64bit, Yinghai Lu, (Sun Jun 1, 11:55 pm)
[PATCH] x86: change propagate_e820_map back to find_max_pf ..., Yinghai Lu, (Mon Jun 2, 7:16 pm)