--- zzzz-none-000/linux-3.10.107/arch/mips/kernel/smp.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/kernel/smp.c 2021-11-10 11:53:54.000000000 +0000 @@ -60,12 +60,17 @@ EXPORT_SYMBOL(smp_num_siblings); /* representing the TCs (or siblings in Intel speak) of each logical CPU */ -cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; -EXPORT_SYMBOL(cpu_sibling_map); +DEFINE_PER_CPU_SHARED_ALIGNED(struct cpumask, cpu_sibling_map); +EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); /* representing cpus for which sibling maps can be computed */ static cpumask_t cpu_sibling_setup_map; +/* CPU siblings in MIPS: + * + * SMVP kernel - VPEs on common core are siblings + * SMTC kernel - TC's on common core are siblings + */ static inline void set_cpu_sibling_map(int cpu) { int i; @@ -75,12 +80,12 @@ if (smp_num_siblings > 1) { for_each_cpu_mask(i, cpu_sibling_setup_map) { if (cpu_data[cpu].core == cpu_data[i].core) { - cpu_set(i, cpu_sibling_map[cpu]); - cpu_set(cpu, cpu_sibling_map[i]); + cpu_set(i, per_cpu(cpu_sibling_map, cpu)); + cpu_set(cpu, per_cpu(cpu_sibling_map, i)); } } } else - cpu_set(cpu, cpu_sibling_map[cpu]); + cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); } struct plat_smp_ops *mp_ops;