x86-64, NUMA: Use common {cpu|mem}_nodes_parsed
ACPI and amd are using separate nodes_parsed masks. Add {cpu|mem}_nodes_parsed and use them in all NUMA init methods. Initialization of the masks and building node_possible_map are now handled commonly by initmem_init(). dummy_numa_init() is updated to set node 0 on both masks. While at it, move the info messages from scan to init. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Shaohui Zheng <shaohui.zheng@intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
@ -25,6 +25,9 @@
|
||||
struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
|
||||
EXPORT_SYMBOL(node_data);
|
||||
|
||||
nodemask_t cpu_nodes_parsed __initdata;
|
||||
nodemask_t mem_nodes_parsed __initdata;
|
||||
|
||||
struct memnode memnode;
|
||||
|
||||
static unsigned long __initdata nodemap_addr;
|
||||
@ -581,23 +584,24 @@ static int __init numa_emulation(unsigned long start_pfn,
|
||||
#endif /* CONFIG_NUMA_EMU */
|
||||
|
||||
static int dummy_numa_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_scan_nodes(void)
|
||||
{
|
||||
printk(KERN_INFO "%s\n",
|
||||
numa_off ? "NUMA turned off" : "No NUMA configuration found");
|
||||
printk(KERN_INFO "Faking a node at %016lx-%016lx\n",
|
||||
0LU, max_pfn << PAGE_SHIFT);
|
||||
|
||||
node_set(0, cpu_nodes_parsed);
|
||||
node_set(0, mem_nodes_parsed);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_scan_nodes(void)
|
||||
{
|
||||
/* setup dummy node covering all memory */
|
||||
memnode_shift = 63;
|
||||
memnodemap = memnode.embedded_map;
|
||||
memnodemap[0] = 0;
|
||||
node_set_online(0);
|
||||
node_set(0, node_possible_map);
|
||||
memblock_x86_register_active_regions(0, 0, max_pfn);
|
||||
init_memory_mapping_high();
|
||||
setup_node_bootmem(0, 0, max_pfn << PAGE_SHIFT);
|
||||
@ -630,6 +634,8 @@ void __init initmem_init(void)
|
||||
for (j = 0; j < MAX_LOCAL_APIC; j++)
|
||||
set_apicid_to_node(j, NUMA_NO_NODE);
|
||||
|
||||
nodes_clear(cpu_nodes_parsed);
|
||||
nodes_clear(mem_nodes_parsed);
|
||||
nodes_clear(node_possible_map);
|
||||
nodes_clear(node_online_map);
|
||||
|
||||
@ -643,6 +649,11 @@ void __init initmem_init(void)
|
||||
nodes_clear(node_possible_map);
|
||||
nodes_clear(node_online_map);
|
||||
#endif
|
||||
/* Account for nodes with cpus and no memory */
|
||||
nodes_or(node_possible_map, mem_nodes_parsed, cpu_nodes_parsed);
|
||||
if (WARN_ON(nodes_empty(node_possible_map)))
|
||||
continue;
|
||||
|
||||
if (!scan_nodes[i]())
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user