提交 797390d8 编写于 作者: T Tejun Heo

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: NTejun 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>
上级 84914ed0
...@@ -91,8 +91,6 @@ static inline void numaq_register_node(int node, struct sys_cfg_data *scd) ...@@ -91,8 +91,6 @@ static inline void numaq_register_node(int node, struct sys_cfg_data *scd)
memblock_x86_register_active_regions(node, node_start_pfn[node], memblock_x86_register_active_regions(node, node_start_pfn[node],
node_end_pfn[node]); node_end_pfn[node]);
memory_present(node, node_start_pfn[node], node_end_pfn[node]);
} }
/* /*
......
...@@ -716,6 +716,7 @@ void __init paging_init(void) ...@@ -716,6 +716,7 @@ void __init paging_init(void)
* NOTE: at this point the bootmem allocator is fully available. * NOTE: at this point the bootmem allocator is fully available.
*/ */
olpc_dt_build_devicetree(); olpc_dt_build_devicetree();
sparse_memory_present_with_active_regions(MAX_NUMNODES);
sparse_init(); sparse_init();
zone_sizes_init(); zone_sizes_init();
} }
......
...@@ -119,7 +119,6 @@ int __init get_memcfg_numa_flat(void) ...@@ -119,7 +119,6 @@ int __init get_memcfg_numa_flat(void)
node_start_pfn[0] = 0; node_start_pfn[0] = 0;
node_end_pfn[0] = max_pfn; node_end_pfn[0] = max_pfn;
memblock_x86_register_active_regions(0, 0, max_pfn); memblock_x86_register_active_regions(0, 0, max_pfn);
memory_present(0, 0, max_pfn);
/* Indicate there is one node available. */ /* Indicate there is one node available. */
nodes_clear(node_online_map); nodes_clear(node_online_map);
......
...@@ -209,7 +209,7 @@ static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_ch ...@@ -209,7 +209,7 @@ static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_ch
int __init get_memcfg_from_srat(void) int __init get_memcfg_from_srat(void)
{ {
int i, j, nid; int i, j;
if (srat_disabled()) if (srat_disabled())
goto out_fail; goto out_fail;
...@@ -273,12 +273,6 @@ int __init get_memcfg_from_srat(void) ...@@ -273,12 +273,6 @@ int __init get_memcfg_from_srat(void)
/* for out of order entries in SRAT */ /* for out of order entries in SRAT */
sort_node_map(); sort_node_map();
for_each_online_node(nid) {
unsigned long start = node_start_pfn[nid];
unsigned long end = min(node_end_pfn[nid], max_pfn);
memory_present(nid, start, end);
}
return 1; return 1;
out_fail: out_fail:
printk(KERN_DEBUG "failed to get NUMA memory information from SRAT" printk(KERN_DEBUG "failed to get NUMA memory information from SRAT"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册