summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_smp.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2014-04-26 20:27:54 +0000
committerscottl <scottl@FreeBSD.org>2014-04-26 20:27:54 +0000
commit62a64f0d2b367aa304943ab5c8508059744c6016 (patch)
tree011b9f559b2fe7a4b0f730214125d5b9ed735d61 /sys/kern/subr_smp.c
parentc08e3d03ca9c9ffe7fff07eaa4e6bc25d451b871 (diff)
downloadFreeBSD-src-62a64f0d2b367aa304943ab5c8508059744c6016.zip
FreeBSD-src-62a64f0d2b367aa304943ab5c8508059744c6016.tar.gz
Retire smp_active. It was racey and caused demonstrated problems with
the cpufreq code. Replace its use with smp_started. There's at least one userland tool that still looks at the kern.smp.active sysctl, so preserve it but point it to smp_started as well. Discussed with: peter, jhb MFC after: 3 days Obtained from: Netflix
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r--sys/kern/subr_smp.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 5425a45..122fc4c 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -59,6 +59,9 @@ cpuset_t logical_cpus_mask;
void (*cpustop_restartfunc)(void);
#endif
+
+static int sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS);
+
/* This is used in modules that need to work in both SMP and UP. */
cpuset_t all_cpus;
@@ -78,9 +81,8 @@ SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxid, 0,
SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus,
0, "Max number of CPUs that the system was compiled for.");
-int smp_active = 0; /* are the APs allowed to run? */
-SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0,
- "Number of Auxillary Processors (APs) that were successfully started");
+SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD | CTLTYPE_INT, NULL, 0,
+ sysctl_kern_smp_active, "I", "Indicates system is running in SMP mode");
int smp_disabled = 0; /* has smp been disabled? */
SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD,
@@ -831,3 +833,15 @@ quiesce_all_cpus(const char *wmesg, int prio)
return quiesce_cpus(all_cpus, wmesg, prio);
}
+
+/* Extra care is taken with this sysctl because the data type is volatile */
+static int
+sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS)
+{
+ int error, active;
+
+ active = smp_started;
+ error = SYSCTL_OUT(req, &active, sizeof(active));
+ return (error);
+}
+
OpenPOWER on IntegriCloud