- It's ok if sched_runnable() has races in it, we don't need the sched_lock

here unless we have something on the assigned queue.
This commit is contained in:
Jeff Roberson 2003-11-05 05:30:12 +00:00
parent 562fb1a6dd
commit 46f8b26550
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122094

View file

@ -1239,11 +1239,13 @@ sched_runnable(void)
load = 1;
mtx_lock_spin(&sched_lock);
kseq = KSEQ_SELF();
#ifdef SMP
if (kseq->ksq_assigned)
if (kseq->ksq_assigned) {
mtx_lock_spin(&sched_lock);
kseq_assign(kseq);
mtx_unlock_spin(&sched_lock);
}
#endif
if ((curthread->td_flags & TDF_IDLETD) != 0) {
if (kseq->ksq_load > 0)
@ -1253,7 +1255,6 @@ sched_runnable(void)
goto out;
load = 0;
out:
mtx_unlock_spin(&sched_lock);
return (load);
}