summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorChristiano F. Haesbaert <haesbaert@cvs.openbsd.org>2012-08-21 19:51:59 +0000
committerChristiano F. Haesbaert <haesbaert@cvs.openbsd.org>2012-08-21 19:51:59 +0000
commit6093d1c2ce00fe21b3d19923b53ae2757daab93e (patch)
treee6696546617fc85649f5bbc42f56988ffe0c8379 /sys/kern
parentcd4341a106f5622841eca0e9637375cc8833778b (diff)
Stop "inlining" setrunnable() we already had two bugs because of it.
This also makes sure we call cpu_unidle() on the correct cpu, since the inlining order was wrong and could call it on the old cpu. ok kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_synch.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index c885f83aa36..f1db615348b 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.103 2012/07/10 16:56:28 haesbaert Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.104 2012/08/21 19:51:58 haesbaert Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -370,20 +370,8 @@ wakeup_n(const volatile void *ident, int n)
--n;
p->p_wchan = 0;
TAILQ_REMOVE(qp, p, p_runq);
- if (p->p_stat == SSLEEP) {
- /* OPTIMIZED EXPANSION OF setrunnable(p); */
- if (p->p_slptime > 1)
- updatepri(p);
- p->p_slptime = 0;
- p->p_stat = SRUN;
- p->p_cpu = sched_choosecpu(p);
- setrunqueue(p);
- if (p->p_priority <
- p->p_cpu->ci_schedstate.spc_curpriority)
- need_resched(p->p_cpu);
- /* END INLINE EXPANSION */
-
- }
+ if (p->p_stat == SSLEEP)
+ setrunnable(p);
}
}
SCHED_UNLOCK(s);