diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2016-09-01 02:55:04 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-09-09 09:59:09 -0400 |
commit | 7ba5f605f3a0d9495aad539eeb8346d726dfc183 (patch) | |
tree | 2b237c38880de2d62b37f21a3e2243476a0c4423 /arch/arm64/mm | |
parent | df7ffa34cc0c06bfa7206732df78725ff34633ee (diff) |
arm64/numa: remove the limitation that cpu0 must bind to node0
1. Remove the old binding code.
2. Read the nid of cpu0 from dts.
3. Fallback the nid of cpu0 to 0 when numa=off is set in bootargs.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r-- | arch/arm64/mm/numa.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 0a15f010b64a..778a985c8a70 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c | |||
@@ -116,16 +116,24 @@ static void __init setup_node_to_cpumask_map(void) | |||
116 | */ | 116 | */ |
117 | void numa_store_cpu_info(unsigned int cpu) | 117 | void numa_store_cpu_info(unsigned int cpu) |
118 | { | 118 | { |
119 | map_cpu_to_node(cpu, numa_off ? 0 : cpu_to_node_map[cpu]); | 119 | map_cpu_to_node(cpu, cpu_to_node_map[cpu]); |
120 | } | 120 | } |
121 | 121 | ||
122 | void __init early_map_cpu_to_node(unsigned int cpu, int nid) | 122 | void __init early_map_cpu_to_node(unsigned int cpu, int nid) |
123 | { | 123 | { |
124 | /* fallback to node 0 */ | 124 | /* fallback to node 0 */ |
125 | if (nid < 0 || nid >= MAX_NUMNODES) | 125 | if (nid < 0 || nid >= MAX_NUMNODES || numa_off) |
126 | nid = 0; | 126 | nid = 0; |
127 | 127 | ||
128 | cpu_to_node_map[cpu] = nid; | 128 | cpu_to_node_map[cpu] = nid; |
129 | |||
130 | /* | ||
131 | * We should set the numa node of cpu0 as soon as possible, because it | ||
132 | * has already been set up online before. cpu_to_node(0) will soon be | ||
133 | * called. | ||
134 | */ | ||
135 | if (!cpu) | ||
136 | set_cpu_numa_node(cpu, nid); | ||
129 | } | 137 | } |
130 | 138 | ||
131 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA | 139 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA |
@@ -393,10 +401,6 @@ static int __init numa_init(int (*init_func)(void)) | |||
393 | 401 | ||
394 | setup_node_to_cpumask_map(); | 402 | setup_node_to_cpumask_map(); |
395 | 403 | ||
396 | /* init boot processor */ | ||
397 | cpu_to_node_map[0] = 0; | ||
398 | map_cpu_to_node(0, 0); | ||
399 | |||
400 | return 0; | 404 | return 0; |
401 | } | 405 | } |
402 | 406 | ||