aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smp.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-07-13 09:12:52 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-07-29 04:19:29 -0400
commit640511ae92466800c75da77a3c7f72b8488c93a1 (patch)
tree53af8725ed47b4861942dffdb412d604fa67d311 /arch/mips/kernel/smp.c
parent6d758bfc7b05b11a4a853c3052cb815f40b82afe (diff)
MIPS: c-r4k: Exclude sibling CPUs in SMP calls
When performing SMP calls to foreign cores, exclude sibling CPUs from the provided map, as we already handle the local core on the current CPU. This prevents an SMP call from for example core 0, VPE 1 to VPE 0 on the same core. In the process the cpu_foreign_map cpumask is turned into an array of cpumasks, so that each CPU has its own version of it which excludes sibling CPUs. r4k_op_needs_ipi() is also updated to reflect that cache management SMP calls are not needed when all CPUs are siblings (i.e. there are no foreign CPUs according to the new cpu_foreign_map[] semantics which exclude siblings). Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com> Cc: Felix Fietkau <nbd@nbd.name> Cc: Jayachandran C. <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/13801/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/smp.c')
-rw-r--r--arch/mips/kernel/smp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 783d5f50ab9d..f95f094f36e4 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(cpu_core_map);
72 * A logcal cpu mask containing only one VPE per core to 72 * A logcal cpu mask containing only one VPE per core to
73 * reduce the number of IPIs on large MT systems. 73 * reduce the number of IPIs on large MT systems.
74 */ 74 */
75cpumask_t cpu_foreign_map __read_mostly; 75cpumask_t cpu_foreign_map[NR_CPUS] __read_mostly;
76EXPORT_SYMBOL(cpu_foreign_map); 76EXPORT_SYMBOL(cpu_foreign_map);
77 77
78/* representing cpus for which sibling maps can be computed */ 78/* representing cpus for which sibling maps can be computed */
@@ -141,7 +141,9 @@ void calculate_cpu_foreign_map(void)
141 cpumask_set_cpu(i, &temp_foreign_map); 141 cpumask_set_cpu(i, &temp_foreign_map);
142 } 142 }
143 143
144 cpumask_copy(&cpu_foreign_map, &temp_foreign_map); 144 for_each_online_cpu(i)
145 cpumask_andnot(&cpu_foreign_map[i],
146 &temp_foreign_map, &cpu_sibling_map[i]);
145} 147}
146 148
147struct plat_smp_ops *mp_ops; 149struct plat_smp_ops *mp_ops;