mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
Convert cpu_sibling_map to be a per cpu variable
Convert cpu_sibling_map from a static array sized by NR_CPUS to a per_cpu variable. This saves sizeof(cpumask_t) * NR unused cpus. Access is mostly from startup and CPU HOTPLUG functions. Signed-off-by: Mike Travis <travis@sgi.com> Cc: Andi Kleen <ak@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0835761129
commit
d5a7430ddc
26 changed files with 107 additions and 82 deletions
|
@ -413,16 +413,28 @@ void __init smp_setup_cpu_maps(void)
|
|||
of_node_put(dn);
|
||||
}
|
||||
|
||||
vdso_data->processorCount = num_present_cpus();
|
||||
#endif /* CONFIG_PPC64 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Being that cpu_sibling_map is now a per_cpu array, then it cannot
|
||||
* be initialized until the per_cpu areas have been created. This
|
||||
* function is now called from setup_per_cpu_areas().
|
||||
*/
|
||||
void __init smp_setup_cpu_sibling_map(void)
|
||||
{
|
||||
#if defined(CONFIG_PPC64)
|
||||
int cpu;
|
||||
|
||||
/*
|
||||
* Do the sibling map; assume only two threads per processor.
|
||||
*/
|
||||
for_each_possible_cpu(cpu) {
|
||||
cpu_set(cpu, cpu_sibling_map[cpu]);
|
||||
cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
|
||||
if (cpu_has_feature(CPU_FTR_SMT))
|
||||
cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]);
|
||||
cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
|
||||
}
|
||||
|
||||
vdso_data->processorCount = num_present_cpus();
|
||||
#endif /* CONFIG_PPC64 */
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue