Rework how we number CPUs on arm64 to try and keep clusters together.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2016-07-25 15:57:13 +00:00
parent abf5bdb441
commit 8ec2b5df73

View File

@ -454,9 +454,16 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
if (id == cpu0)
return (1);
/*
* Rotate the CPU IDs to put the boot CPU as CPU 0. We keep the other
* CPUs ordered as the are likely grouped into clusters so it can be
* useful to keep that property, e.g. for the GICv3 driver to send
* an IPI to all CPUs in the cluster.
*/
cpuid = id;
if (cpuid < cpu0)
cpuid++;
cpuid += mp_maxid + 1;
cpuid -= cpu0;
pcpup = &__pcpu[cpuid];
pcpu_init(pcpup, cpuid, sizeof(struct pcpu));