Re: [PATCH] scheduler cleanup

Andrea Arcangeli (andrea@suse.de)
Thu, 14 Oct 1999 16:05:44 +0200 (CEST)


On Thu, 14 Oct 1999, Artur Skawina wrote:

>just like if it had current->counter==0.

current->counter means _nothing_. You can set the current->counter to zero
and _nothing_ will happens returning from sched_yield(). The only thing
which matter is current->need_resched.

>> I think I see what Andrea means here. Scenario: CPU 0 runs process A,
>> CPU 1 is idle, runqueue has only A. RT process B wakes up, previously
>> run on CPU 0 and decides switching to CPU 1 is too expensive. Process
>> A calls sched_yield(). You better reschedule.
>
>"decides switching to CPU 1 is too expensive" does not happen when CPU1
>is idle. see wake_up_process()/reschedule_idle().

No. Even if CPU1 is idle the task can be _not_ rescheduled on the idle
CPU1. _You_ should read reschedule_idle(). It's what I tring to tell you
since 2/3 email ago.

Precisely you are completly missing this line:

if (target_tsk && p->avg_slice > cacheflush_time)
goto send_now;

Also even if the above wouldn't be implemented it's really bad to depend
on a precise reschedule_idle behaviour that may vary over the time and
it's orthogonal with the other code as far as it's safe and provides the
necessary semantics to wake tasks corrrectly.

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/