[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1242100517.10593.7.camel@sli10-desk.sh.intel.com>
Date: Tue, 12 May 2009 11:55:17 +0800
From: Shaohua Li <shaohua.li@...el.com>
To: lkml <linux-kernel@...r.kernel.org>
Cc: "Yang, Sheng" <sheng.yang@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH]X86: make sparse mem work in non-NUMA mode
With sparse, memory holes should not be marked present for memmap.
This patch makes sparse really works on non-NUMA mode.
Signed-off-by: Shaohua Li <shaohua.li@...el.com>
Signed-off-by: Sheng Yang <sheng.yang@...el.com>
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 749559e..bc95c7a 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -761,15 +761,15 @@ void __init initmem_init(unsigned long start_pfn,
highstart_pfn = highend_pfn = max_pfn;
if (max_pfn > max_low_pfn)
highstart_pfn = max_low_pfn;
- memory_present(0, 0, highend_pfn);
e820_register_active_regions(0, 0, highend_pfn);
+ sparse_memory_present_with_active_regions(0);
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);
e820_register_active_regions(0, 0, max_low_pfn);
+ sparse_memory_present_with_active_regions(0);
num_physpages = max_low_pfn;
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
#endif
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1753e80..dcf099c 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -638,7 +638,7 @@ void __init paging_init(void)
max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
max_zone_pfns[ZONE_NORMAL] = max_pfn;
- memory_present(0, 0, max_pfn);
+ sparse_memory_present_with_active_regions(0);
sparse_init();
free_area_init_nodes(max_zone_pfns);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists