summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-11-29 23:12:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-11-29 23:12:31 +0000
commite54f442105ee2dd1c3bd2b954328a6e8969922dd (patch)
tree2be82d2447a340f2e786b05364cd8f96cc9a7a9b /sys/kern
parenta703e29b473dc139dbf1f2624dac6abea5cd10d0 (diff)
Backout previous commit. There is a possible race which makes it possible
for sys_reboot() to hang forever.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sched.c14
-rw-r--r--sys/kern/kern_xxx.c21
2 files changed, 3 insertions, 32 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index 6066c6a92f4..58b2ab73436 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sched.c,v 1.15 2009/11/25 11:01:14 kettenis Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.16 2009/11/29 23:12:30 kettenis Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
@@ -146,11 +146,6 @@ sched_idle(void *v)
splassert(IPL_NONE);
- if (spc->spc_schedflags & SPCF_SHOULDHALT) {
- spc->spc_schedflags |= SPCF_HALTED;
- wakeup(spc);
- }
-
cpuset_add(&sched_idle_cpus, ci);
cpu_idle_enter();
while (spc->spc_whichqs == 0)
@@ -251,13 +246,6 @@ sched_chooseproc(void)
SCHED_ASSERT_LOCKED();
- if (spc->spc_schedflags & SPCF_SHOULDHALT) {
- p = spc->spc_idleproc;
- KASSERT(p);
- p->p_stat = SRUN;
- return (p);
- }
-
again:
if (spc->spc_whichqs) {
queue = ffs(spc->spc_whichqs) - 1;
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c
index a842462a218..654ed83dc4f 100644
--- a/sys/kern/kern_xxx.c
+++ b/sys/kern/kern_xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_xxx.c,v 1.13 2009/11/25 11:01:14 kettenis Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.14 2009/11/29 23:12:30 kettenis Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
@@ -53,7 +53,7 @@ sys_reboot(struct proc *p, void *v, register_t *retval)
} */ *uap = v;
CPU_INFO_ITERATOR cii;
struct cpu_info *ci;
- int error, s;
+ int error;
if ((error = suser(p, 0)) != 0)
return (error);
@@ -68,23 +68,6 @@ sys_reboot(struct proc *p, void *v, register_t *retval)
}
}
- /*
- * Make sure we stop the secondary CPUs.
- */
- s = splstatclock();
- CPU_INFO_FOREACH(cii, ci) {
- if (CPU_IS_PRIMARY(ci))
- continue;
- ci->ci_schedstate.spc_schedflags |= SPCF_SHOULDHALT;
- }
- CPU_INFO_FOREACH(cii, ci) {
- if (CPU_IS_PRIMARY(ci))
- continue;
- while ((ci->ci_schedstate.spc_schedflags & SPCF_HALTED) == 0)
- tsleep(&ci->ci_schedstate, PZERO, "schedstate", 0);
- }
- splx(s);
-
if_downall();
boot(SCARG(uap, opt));