forked from Minki/linux
x86, NUMA: Drop @start/last_pfn from initmem_init()
initmem_init() extensively accesses and modifies global data structures and the parameters aren't even followed depending on which path is being used. Drop @start/last_pfn and let it deal with @max_pfn directly. This is in preparation for further NUMA init cleanups. - v2: x86-32 initmem_init() weren't updated breaking 32bit builds. Fixed. Found by Yinghai. 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:
parent
13081df5dd
commit
86ef4dbf1f
@ -56,8 +56,7 @@ extern unsigned long init_memory_mapping(unsigned long start,
|
||||
|
||||
void init_memory_mapping_high(void);
|
||||
|
||||
extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn,
|
||||
int acpi, int k8);
|
||||
extern void initmem_init(int acpi, int k8);
|
||||
extern void free_initmem(void);
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
@ -1003,7 +1003,7 @@ void __init setup_arch(char **cmdline_p)
|
||||
amd = !amd_numa_init(0, max_pfn);
|
||||
#endif
|
||||
|
||||
initmem_init(0, max_pfn, acpi, amd);
|
||||
initmem_init(acpi, amd);
|
||||
memblock_find_dma_reserve();
|
||||
dma32_reserve_bootmem();
|
||||
|
||||
|
@ -644,8 +644,7 @@ void __init find_low_pfn_range(void)
|
||||
}
|
||||
|
||||
#ifndef CONFIG_NEED_MULTIPLE_NODES
|
||||
void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
|
||||
int acpi, int k8)
|
||||
void __init initmem_init(int acpi, int k8)
|
||||
{
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
highstart_pfn = highend_pfn = max_pfn;
|
||||
|
@ -603,10 +603,9 @@ kernel_physical_mapping_init(unsigned long start,
|
||||
}
|
||||
|
||||
#ifndef CONFIG_NUMA
|
||||
void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
|
||||
int acpi, int k8)
|
||||
void __init initmem_init(int acpi, int k8)
|
||||
{
|
||||
memblock_x86_register_active_regions(0, start_pfn, end_pfn);
|
||||
memblock_x86_register_active_regions(0, 0, max_pfn);
|
||||
init_memory_mapping_high();
|
||||
}
|
||||
#endif
|
||||
|
@ -352,8 +352,7 @@ static void init_remap_allocator(int nid)
|
||||
(ulong) node_remap_end_vaddr[nid]);
|
||||
}
|
||||
|
||||
void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
|
||||
int acpi, int k8)
|
||||
void __init initmem_init(int acpi, int k8)
|
||||
{
|
||||
int nid;
|
||||
long kva_target_pfn;
|
||||
|
@ -579,8 +579,7 @@ static int __init numa_emulation(unsigned long start_pfn,
|
||||
}
|
||||
#endif /* CONFIG_NUMA_EMU */
|
||||
|
||||
void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
|
||||
int acpi, int amd)
|
||||
void __init initmem_init(int acpi, int amd)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -588,19 +587,16 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
|
||||
nodes_clear(node_online_map);
|
||||
|
||||
#ifdef CONFIG_NUMA_EMU
|
||||
setup_physnodes(start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT,
|
||||
acpi, amd);
|
||||
if (cmdline && !numa_emulation(start_pfn, last_pfn, acpi, amd))
|
||||
setup_physnodes(0, max_pfn << PAGE_SHIFT, acpi, amd);
|
||||
if (cmdline && !numa_emulation(0, max_pfn, acpi, amd))
|
||||
return;
|
||||
setup_physnodes(start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT,
|
||||
acpi, amd);
|
||||
setup_physnodes(0, max_pfn << PAGE_SHIFT, acpi, amd);
|
||||
nodes_clear(node_possible_map);
|
||||
nodes_clear(node_online_map);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
if (!numa_off && acpi && !acpi_scan_nodes(start_pfn << PAGE_SHIFT,
|
||||
last_pfn << PAGE_SHIFT))
|
||||
if (!numa_off && acpi && !acpi_scan_nodes(0, max_pfn << PAGE_SHIFT))
|
||||
return;
|
||||
nodes_clear(node_possible_map);
|
||||
nodes_clear(node_online_map);
|
||||
@ -616,8 +612,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
|
||||
numa_off ? "NUMA turned off" : "No NUMA configuration found");
|
||||
|
||||
printk(KERN_INFO "Faking a node at %016lx-%016lx\n",
|
||||
start_pfn << PAGE_SHIFT,
|
||||
last_pfn << PAGE_SHIFT);
|
||||
0LU, max_pfn << PAGE_SHIFT);
|
||||
/* setup dummy node covering all memory */
|
||||
memnode_shift = 63;
|
||||
memnodemap = memnode.embedded_map;
|
||||
@ -626,9 +621,9 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
|
||||
node_set(0, node_possible_map);
|
||||
for (i = 0; i < MAX_LOCAL_APIC; i++)
|
||||
set_apicid_to_node(i, NUMA_NO_NODE);
|
||||
memblock_x86_register_active_regions(0, start_pfn, last_pfn);
|
||||
memblock_x86_register_active_regions(0, 0, max_pfn);
|
||||
init_memory_mapping_high();
|
||||
setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT);
|
||||
setup_node_bootmem(0, 0, max_pfn << PAGE_SHIFT);
|
||||
numa_init_array();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user