summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-02-10 19:07:32 +0000
committerjake <jake@FreeBSD.org>2001-02-10 19:07:32 +0000
commit8b17f4e83c52c12713463ff12095b71e062bec90 (patch)
tree3a75ad35704a822508fad39122fe2bfa08362414 /sys/kern/kern_synch.c
parentc6a14de213ec9c7f67d95768ea571c6411cfc676 (diff)
downloadFreeBSD-src-8b17f4e83c52c12713463ff12095b71e062bec90.zip
FreeBSD-src-8b17f4e83c52c12713463ff12095b71e062bec90.tar.gz
Acquire sched_lock around need_resched() in roundrobin() to satisfy
assertions that it is held. Since roundrobin() is a timeout there's no possible way that it could be called with sched_lock held.
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 8f54602..be0ba85 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -167,16 +167,12 @@ static void
roundrobin(arg)
void *arg;
{
-#ifndef SMP
- struct proc *p = curproc; /* XXX */
-#endif
-
-#ifdef SMP
+
+ mtx_lock_spin(&sched_lock);
need_resched();
+ mtx_unlock_spin(&sched_lock);
+#ifdef SMP
forward_roundrobin();
-#else
- if (p == PCPU_GET(idleproc) || RTP_PRIO_NEED_RR(p->p_rtprio.type))
- need_resched();
#endif
callout_reset(&roundrobin_callout, sched_quantum, roundrobin, NULL);
OpenPOWER on IntegriCloud