summaryrefslogtreecommitdiff
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-07-03 05:33:09 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-07-03 05:33:09 +0000
commit8f451b4114c7637700b76b2cd9a72ea4caf0d14e (patch)
treebe3cac17ec6111e14fea76adce85d0ae2fdabe89 /sys/kern/kern_synch.c
parent64acb05b1cbd25366c2f227a1683eebd976c0ac4 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index ce6adb5e091b..344719d273cc 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -120,6 +120,10 @@ roundrobin_interval(void)
/*
* Force switch among equal priority processes every 100ms.
+ * We don't actually need to force a context switch of the current process.
+ * The act of firing the event triggers a context switch to softclock() and
+ * then switching back out again which is equivalent to a preemption, thus
+ * no further work is needed on the local CPU.
*/
/* ARGSUSED */
static void
@@ -127,12 +131,11 @@ roundrobin(arg)
void *arg;
{
- mtx_lock_spin(&sched_lock);
- need_resched(curproc);
#ifdef SMP
+ mtx_lock_spin(&sched_lock);
forward_roundrobin();
-#endif
mtx_unlock_spin(&sched_lock);
+#endif
callout_reset(&roundrobin_callout, sched_quantum, roundrobin, NULL);
}