diff options
author | 2012-08-21 19:51:58 +0000 | |
---|---|---|
committer | 2012-08-21 19:51:58 +0000 | |
commit | 918b8b4ea2eb3437c012863311f6397cae62195d (patch) | |
tree | 91792421001876d3f9c3d13df69b0dd7f442d5b2 | |
parent | Reverse the name and meaning of the IFXF_INET6_PRIVACY interface (diff) | |
download | wireguard-openbsd-918b8b4ea2eb3437c012863311f6397cae62195d.tar.xz wireguard-openbsd-918b8b4ea2eb3437c012863311f6397cae62195d.zip |
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@
-rw-r--r-- | sys/kern/kern_synch.c | 18 |
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); |