summaryrefslogtreecommitdiff
path: root/arch/x86/mm/numa_64.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-16 11:13:07 (GMT)
committerTejun Heo <tj@kernel.org>2011-02-16 11:13:07 (GMT)
commit206e42087a037fa3adca8908fd318a0cb64d4dee (patch)
tree044cc262b03c62064a65d13b119b6f73da5c22f4 /arch/x86/mm/numa_64.c
parent45fe6c78c4ccc384044d1b4877eebe7acf359e76 (diff)
downloadlinux-fsl-qoriq-206e42087a037fa3adca8908fd318a0cb64d4dee.tar.xz
x86-64, NUMA: Use common numa_nodes[]
ACPI and amd are using separate nodes[] array. Add numa_nodes[] and use them in all NUMA init methods. cutoff_node() cleanup is moved from srat_64.c to numa_64.c and applied in initmem_init() regardless of init methods. 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>
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r--arch/x86/mm/numa_64.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 4404e1d..a6b899f 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -33,6 +33,8 @@ struct memnode memnode;
static unsigned long __initdata nodemap_addr;
static unsigned long __initdata nodemap_size;
+struct bootnode numa_nodes[MAX_NUMNODES] __initdata;
+
/*
* Given a shift value, try to populate memnodemap[]
* Returns :
@@ -182,6 +184,22 @@ static void * __init early_node_mem(int nodeid, unsigned long start,
return NULL;
}
+static __init void cutoff_node(int i, unsigned long start, unsigned long end)
+{
+ struct bootnode *nd = &numa_nodes[i];
+
+ if (nd->start < start) {
+ nd->start = start;
+ if (nd->end < nd->start)
+ nd->start = nd->end;
+ }
+ if (nd->end > end) {
+ nd->end = end;
+ if (nd->start > nd->end)
+ nd->start = nd->end;
+ }
+}
+
/* Initialize bootmem allocator for a node */
void __init
setup_node_bootmem(int nodeid, unsigned long start, unsigned long end)
@@ -638,9 +656,15 @@ void __init initmem_init(void)
nodes_clear(mem_nodes_parsed);
nodes_clear(node_possible_map);
nodes_clear(node_online_map);
+ memset(numa_nodes, 0, sizeof(numa_nodes));
if (numa_init[i]() < 0)
continue;
+
+ /* clean up the node list */
+ for (j = 0; j < MAX_NUMNODES; j++)
+ cutoff_node(j, 0, max_pfn << PAGE_SHIFT);
+
#ifdef CONFIG_NUMA_EMU
setup_physnodes(0, max_pfn << PAGE_SHIFT, i == 0, i == 1);
if (cmdline && !numa_emulation(0, max_pfn, i == 0, i == 1))