diff options
author | jhb <jhb@FreeBSD.org> | 2008-11-18 05:41:34 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-11-18 05:41:34 +0000 |
commit | b08d457fbe340c0bd96abe214a4c943518c81bbe (patch) | |
tree | 01ca7b84ea5d6666b0267b7bdf20c1e24f28e04e /sys/kern | |
parent | f9226694db55935726acca900e71e7fa685f80b1 (diff) | |
download | FreeBSD-src-b08d457fbe340c0bd96abe214a4c943518c81bbe.zip FreeBSD-src-b08d457fbe340c0bd96abe214a4c943518c81bbe.tar.gz |
When checking to see if another CPU is running its idle thread, examine
the thread running on the other CPU instead of the thread being placed on
the run queue.
Reported by: Ravi Murty @ Intel
Reviewed by: jeff
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sched_ule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 377f815..056a7bc 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -946,7 +946,7 @@ tdq_idled(struct tdq *tdq) static void tdq_notify(struct tdq *tdq, struct thread *td) { - int cpri; + struct thread *ctd; int pri; int cpu; @@ -954,10 +954,10 @@ tdq_notify(struct tdq *tdq, struct thread *td) return; cpu = td->td_sched->ts_cpu; pri = td->td_priority; - cpri = pcpu_find(cpu)->pc_curthread->td_priority; - if (!sched_shouldpreempt(pri, cpri, 1)) + ctd = pcpu_find(cpu)->pc_curthread; + if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; - if (TD_IS_IDLETHREAD(td)) { + if (TD_IS_IDLETHREAD(ctd)) { /* * If the idle thread is still 'running' it's probably * waiting on us to release the tdq spinlock already. No |