Re: [Lse-tech] Re: CPU affinity & IPI latency (FIX)_

Davide Libenzi
2001-07-17T18:08:55Z

> In an attempt to inline the code, somehow the tabs got lost. So here is the
> attached correct patch fo 2.4.5. Please try and let me know whether you
> see your problems disappear and/or others arise.
> The sketchy writeup is still the same.

What is the reason You don't set the resched task in the fast path ?

best_cpu = p->processor;
if (can_schedule(p, best_cpu)) {
tsk = idle_task(best_cpu);
if ((cpu_curr(best_cpu) == tsk) &&
(cpu_resched(best_cpu) == NULL)) {
int need_resched;
send_now_idle:
/*
* If need_resched == -1 then we can skip sending
* the IPI altogether, tsk->need_resched is
* actively watched by the idle thread.
*/
need_resched = tsk->need_resched;
tsk->need_resched = 1;
if ((best_cpu != this_cpu) && !need_resched) {
>>>> cpu_resched(best_cpu) = p;
smp_send_reschedule(best_cpu);
}
return;
}
}

- Davide