summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-08-09 18:59:16 +0000
committerjhb <jhb@FreeBSD.org>2016-08-09 18:59:16 +0000
commit80efa32df7d6cf2f338d372d40e82029bef08cf5 (patch)
tree1d6dd3b0951b65d253008ae1d1c9b46c13f5ad65 /sys/kern
parent0f996b20a4acb478a13ddb746bc9ee1b321b9bb5 (diff)
downloadFreeBSD-src-80efa32df7d6cf2f338d372d40e82029bef08cf5.zip
FreeBSD-src-80efa32df7d6cf2f338d372d40e82029bef08cf5.tar.gz
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.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_4bsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 676bd35..28ca5e1 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -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;
OpenPOWER on IntegriCloud