Didn't intend to commit the CPU_IS_RUNNING() changes just yet, so revert
authorkettenis <kettenis@openbsd.org>
Tue, 29 Jun 2021 21:31:49 +0000 (21:31 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 29 Jun 2021 21:31:49 +0000 (21:31 +0000)
those bits.

sys/kern/kern_sched.c
sys/kern/kern_smr.c

index 6696194..4803b55 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_sched.c,v 1.70 2021/06/29 21:27:53 kettenis Exp $        */
+/*     $OpenBSD: kern_sched.c,v 1.71 2021/06/29 21:31:49 kettenis Exp $        */
 /*
  * Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
  *
@@ -638,7 +638,7 @@ sched_start_secondary_cpus(void)
        CPU_INFO_FOREACH(cii, ci) {
                struct schedstate_percpu *spc = &ci->ci_schedstate;
 
-               if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
+               if (CPU_IS_PRIMARY(ci))
                        continue;
                atomic_clearbits_int(&spc->spc_schedflags,
                    SPCF_SHOULDHALT | SPCF_HALTED);
@@ -656,14 +656,13 @@ sched_stop_secondary_cpus(void)
        CPU_INFO_ITERATOR cii;
        struct cpu_info *ci;
 
-       printf("%s: start\n", __func__);
        /*
         * Make sure we stop the secondary CPUs.
         */
        CPU_INFO_FOREACH(cii, ci) {
                struct schedstate_percpu *spc = &ci->ci_schedstate;
 
-               if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
+               if (CPU_IS_PRIMARY(ci))
                        continue;
                cpuset_del(&sched_all_cpus, ci);
                atomic_setbits_int(&spc->spc_schedflags, SPCF_SHOULDHALT);
@@ -672,7 +671,7 @@ sched_stop_secondary_cpus(void)
                struct schedstate_percpu *spc = &ci->ci_schedstate;
                struct sleep_state sls;
 
-               if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
+               if (CPU_IS_PRIMARY(ci))
                        continue;
                while ((spc->spc_schedflags & SPCF_HALTED) == 0) {
                        sleep_setup(&sls, spc, PZERO, "schedstate", 0);
@@ -680,7 +679,6 @@ sched_stop_secondary_cpus(void)
                            (spc->spc_schedflags & SPCF_HALTED) == 0);
                }
        }
-       printf("%s: end\n", __func__);
 }
 
 struct sched_barrier_state {
@@ -871,7 +869,7 @@ sysctl_hwsmt(void *oldp, size_t *oldlenp, void *newp, size_t newlen)
 
        sched_smt = newsmt;
        CPU_INFO_FOREACH(cii, ci) {
-               if (CPU_IS_PRIMARY(ci) || !CPU_IS_RUNNING(ci))
+               if (CPU_IS_PRIMARY(ci))
                        continue;
                if (ci->ci_smt_id == 0)
                        continue;
index 99a6f73..e002e56 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_smr.c,v 1.10 2021/06/29 21:27:53 kettenis Exp $  */
+/*     $OpenBSD: kern_smr.c,v 1.11 2021/06/29 21:31:49 kettenis Exp $  */
 
 /*
  * Copyright (c) 2019-2020 Visa Hankala
@@ -149,8 +149,6 @@ smr_grace_wait(void)
        curcpu()->ci_schedstate.spc_smrgp = smrgp;
 
        CPU_INFO_FOREACH(cii, ci) {
-               if (!CPU_IS_RUNNING(ci))
-                       continue;
                if (READ_ONCE(ci->ci_schedstate.spc_smrgp) == smrgp)
                        continue;
                sched_peg_curproc(ci);