svn commit: r303307 - head/sys/arm64/arm64

Andrew Turner andrew at FreeBSD.org
Mon Jul 25 15:57:15 UTC 2016


Author: andrew
Date: Mon Jul 25 15:57:13 2016
New Revision: 303307
URL: https://svnweb.freebsd.org/changeset/base/303307

Log:
  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

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==============================================================================
--- head/sys/arm64/arm64/mp_machdep.c	Mon Jul 25 15:56:37 2016	(r303306)
+++ head/sys/arm64/arm64/mp_machdep.c	Mon Jul 25 15:57:13 2016	(r303307)
@@ -454,9 +454,16 @@ cpu_init_fdt(u_int id, phandle_t node, u
 	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));


More information about the svn-src-head mailing list