svn commit: r344659 - head/sys/arm64/arm64
Andrew Turner
andrew at FreeBSD.org
Thu Feb 28 14:40:44 UTC 2019
Author: andrew
Date: Thu Feb 28 14:40:43 2019
New Revision: 344659
URL: https://svnweb.freebsd.org/changeset/base/344659
Log:
Add the hw.ncpu tunable to arm64.
This allows us to limit the number of CPUs to use, e.g. to debug problems
seen when enabling multiple clusters.
Reviewed by: manu
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19404
Modified:
head/sys/arm64/arm64/mp_machdep.c
Modified: head/sys/arm64/arm64/mp_machdep.c
==============================================================================
--- head/sys/arm64/arm64/mp_machdep.c Thu Feb 28 09:42:03 2019 (r344658)
+++ head/sys/arm64/arm64/mp_machdep.c Thu Feb 28 14:40:43 2019 (r344659)
@@ -638,10 +638,11 @@ cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr
void
cpu_mp_setmaxid(void)
{
-#if defined(DEV_ACPI) || defined(FDT)
int cores;
-#endif
+ mp_ncpus = 1;
+ mp_maxid = 0;
+
switch(arm64_bus_method) {
#ifdef DEV_ACPI
case ARM64_BUS_ACPI:
@@ -653,7 +654,6 @@ cpu_mp_setmaxid(void)
cores);
mp_ncpus = cores;
mp_maxid = cores - 1;
- return;
}
break;
#endif
@@ -667,18 +667,21 @@ cpu_mp_setmaxid(void)
cores);
mp_ncpus = cores;
mp_maxid = cores - 1;
- return;
}
break;
#endif
default:
+ if (bootverbose)
+ printf("No CPU data, limiting to 1 core\n");
break;
}
- if (bootverbose)
- printf("No CPU data, limiting to 1 core\n");
- mp_ncpus = 1;
- mp_maxid = 0;
+ if (TUNABLE_INT_FETCH("hw.ncpu", &cores)) {
+ if (cores > 0 && cores < mp_ncpus) {
+ mp_ncpus = cores;
+ mp_maxid = cores - 1;
+ }
+ }
}
/*
More information about the svn-src-head
mailing list