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
This commit is contained in:
jhb 2008-11-18 05:41:34 +00:00
parent f9226694db
commit b08d457fbe

View File

@ -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