From b08d457fbe340c0bd96abe214a4c943518c81bbe Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 18 Nov 2008 05:41:34 +0000 Subject: [PATCH] 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 --- sys/kern/sched_ule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 377f8152e385..056a7bcbd53e 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