aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_32.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-03-04 15:21:24 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-04 16:09:59 -0500
commitfc5efe3941c47c0278fe1bbcf8cc02a03a74fcda (patch)
treeb38d2989c0dd2d6b31212093b2035ef000229559 /arch/x86/mm/init_32.c
parent731ddea63600c24ff01e6e5144cea88bf7266ac5 (diff)
x86: fix bootmem cross node for 32bit numa, cleanup
Impact: clean up Simplify the code, reuse some lines. Remove min_low_pfn reference, it is always 0 Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> LKML-Reference: <49AEE2C4.2030602@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r--arch/x86/mm/init_32.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index c69c6b1f5e55..c351456d06dc 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -776,7 +776,6 @@ static void __init zone_sizes_init(void)
776 free_area_init_nodes(max_zone_pfns); 776 free_area_init_nodes(max_zone_pfns);
777} 777}
778 778
779#ifdef CONFIG_NEED_MULTIPLE_NODES
780static unsigned long __init setup_node_bootmem(int nodeid, 779static unsigned long __init setup_node_bootmem(int nodeid,
781 unsigned long start_pfn, 780 unsigned long start_pfn,
782 unsigned long end_pfn, 781 unsigned long end_pfn,
@@ -802,7 +801,6 @@ static unsigned long __init setup_node_bootmem(int nodeid,
802 801
803 return bootmap + bootmap_size; 802 return bootmap + bootmap_size;
804} 803}
805#endif
806 804
807void __init setup_bootmem_allocator(void) 805void __init setup_bootmem_allocator(void)
808{ 806{
@@ -812,8 +810,7 @@ void __init setup_bootmem_allocator(void)
812 * Initialize the boot-time allocator (with low memory only): 810 * Initialize the boot-time allocator (with low memory only):
813 */ 811 */
814 bootmap_size = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT; 812 bootmap_size = bootmem_bootmap_pages(max_low_pfn)<<PAGE_SHIFT;
815 bootmap = find_e820_area(min_low_pfn<<PAGE_SHIFT, 813 bootmap = find_e820_area(0, max_pfn_mapped<<PAGE_SHIFT, bootmap_size,
816 max_pfn_mapped<<PAGE_SHIFT, bootmap_size,
817 PAGE_SIZE); 814 PAGE_SIZE);
818 if (bootmap == -1L) 815 if (bootmap == -1L)
819 panic("Cannot find bootmem map of size %ld\n", bootmap_size); 816 panic("Cannot find bootmem map of size %ld\n", bootmap_size);
@@ -821,21 +818,14 @@ void __init setup_bootmem_allocator(void)
821 818
822 printk(KERN_INFO " mapped low ram: 0 - %08lx\n", 819 printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
823 max_pfn_mapped<<PAGE_SHIFT); 820 max_pfn_mapped<<PAGE_SHIFT);
824 printk(KERN_INFO " low ram: %08lx - %08lx\n", 821 printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT);
825 min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT);
826 822
827#ifdef CONFIG_NEED_MULTIPLE_NODES 823#ifdef CONFIG_NEED_MULTIPLE_NODES
828 for_each_online_node(nodeid) 824 for_each_online_node(nodeid)
829 bootmap = setup_node_bootmem(nodeid, node_start_pfn[nodeid], 825 bootmap = setup_node_bootmem(nodeid, node_start_pfn[nodeid],
830 node_end_pfn[nodeid], bootmap); 826 node_end_pfn[nodeid], bootmap);
831#else 827#else
832 /* don't touch min_low_pfn */ 828 bootmap = setup_node_bootmem(0, 0, max_low_pfn, bootmap);
833 bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap >> PAGE_SHIFT,
834 min_low_pfn, max_low_pfn);
835 printk(KERN_INFO " bootmap %08lx - %08lx\n",
836 bootmap, bootmap + bootmap_size);
837 free_bootmem_with_active_regions(0, max_low_pfn);
838 early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT);
839#endif 829#endif
840 830
841 after_init_bootmem = 1; 831 after_init_bootmem = 1;