aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-05-02 08:18:52 -0400
committerTejun Heo <tj@kernel.org>2011-05-02 08:18:52 -0400
commit797390d8554b1e07aabea37d0140933b0412dba0 (patch)
tree81ec97a19bcd03de733a73fea8c88a84b64044ad /arch/x86/mm
parent84914ed0ec6787d38e84b510f92ad4ca3a572fd8 (diff)
x86-32, NUMA: use sparse_memory_present_with_active_regions()
Instead of calling memory_present() for each region from NUMA init, call sparse_memory_present_with_active_regions() from paging_init() similarly to x86-64. For flat and numaq, this results in exactly the same memory_present() calls. For srat, if there are multiple memory chunks for a node, after this change, memory_present() will be called separately for each chunk instead of being called once to encompass the whole range, which doesn't cause any harm and actually is the better behavior. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init_32.c1
-rw-r--r--arch/x86/mm/numa_32.c1
-rw-r--r--arch/x86/mm/srat_32.c8
3 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 80088f994193..2cde0a34bed6 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -716,6 +716,7 @@ void __init paging_init(void)
716 * NOTE: at this point the bootmem allocator is fully available. 716 * NOTE: at this point the bootmem allocator is fully available.
717 */ 717 */
718 olpc_dt_build_devicetree(); 718 olpc_dt_build_devicetree();
719 sparse_memory_present_with_active_regions(MAX_NUMNODES);
719 sparse_init(); 720 sparse_init();
720 zone_sizes_init(); 721 zone_sizes_init();
721} 722}
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index e0d9716ab382..f847fa1e02dc 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -119,7 +119,6 @@ int __init get_memcfg_numa_flat(void)
119 node_start_pfn[0] = 0; 119 node_start_pfn[0] = 0;
120 node_end_pfn[0] = max_pfn; 120 node_end_pfn[0] = max_pfn;
121 memblock_x86_register_active_regions(0, 0, max_pfn); 121 memblock_x86_register_active_regions(0, 0, max_pfn);
122 memory_present(0, 0, max_pfn);
123 122
124 /* Indicate there is one node available. */ 123 /* Indicate there is one node available. */
125 nodes_clear(node_online_map); 124 nodes_clear(node_online_map);
diff --git a/arch/x86/mm/srat_32.c b/arch/x86/mm/srat_32.c
index ae20046a9e98..6b9bfd78bc35 100644
--- a/arch/x86/mm/srat_32.c
+++ b/arch/x86/mm/srat_32.c
@@ -209,7 +209,7 @@ static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_ch
209 209
210int __init get_memcfg_from_srat(void) 210int __init get_memcfg_from_srat(void)
211{ 211{
212 int i, j, nid; 212 int i, j;
213 213
214 if (srat_disabled()) 214 if (srat_disabled())
215 goto out_fail; 215 goto out_fail;
@@ -273,12 +273,6 @@ int __init get_memcfg_from_srat(void)
273 /* for out of order entries in SRAT */ 273 /* for out of order entries in SRAT */
274 sort_node_map(); 274 sort_node_map();
275 275
276 for_each_online_node(nid) {
277 unsigned long start = node_start_pfn[nid];
278 unsigned long end = min(node_end_pfn[nid], max_pfn);
279
280 memory_present(nid, start, end);
281 }
282 return 1; 276 return 1;
283out_fail: 277out_fail:
284 printk(KERN_DEBUG "failed to get NUMA memory information from SRAT" 278 printk(KERN_DEBUG "failed to get NUMA memory information from SRAT"