summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/sched_4bsd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 333db66..88a5494 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1167,7 +1167,10 @@ sched_pickcpu(struct thread *td)
mtx_assert(&sched_lock, MA_OWNED);
- best = NOCPU;
+ if (THREAD_CAN_SCHED(td, td->td_lastcpu))
+ best = td->td_lastcpu;
+ else
+ best = NOCPU;
for (cpu = 0; cpu <= mp_maxid; cpu++) {
if (CPU_ABSENT(cpu))
continue;
OpenPOWER on IntegriCloud