Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2016 15:57:14 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303307 - head/sys/arm64/arm64
Message-ID:  <201607251557.u6PFvEle077319@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607251557.u6PFvEle077319>