Remove bogus need_resched() of the current CPU in roundrobin().
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.
This commit is contained in:
parent
7bb1f29898
commit
774b040e8a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user