MFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.

If a thread is created bound to a cpuset it might already be bound before
its very first timeslice, and td_lastcpu will be NOCPU in that case.
This commit is contained in:
jhb 2016-08-09 18:59:16 +00:00
parent 0f996b20a4
commit 80efa32df7

View File

@ -1235,7 +1235,7 @@ sched_pickcpu(struct thread *td)
mtx_assert(&sched_lock, MA_OWNED);
if (THREAD_CAN_SCHED(td, td->td_lastcpu))
if (td->td_lastcpu != NOCPU && THREAD_CAN_SCHED(td, td->td_lastcpu))
best = td->td_lastcpu;
else
best = NOCPU;