Re: [PATCH] scheduler cleanup

Andrea Arcangeli (andrea@suse.de)
Thu, 14 Oct 1999 02:02:52 +0200 (CEST)


On Thu, 14 Oct 1999, Borislav Deianov wrote:

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

If you remove the underlined characters, that was exactly my point.

Your scenario can't happen because if B is a RT task, then A will be
rescheduled immediatly and B will take the CPU. But if B is _not_ a RT
task, then B may stay waiting for A to reschedule and so you can't skip
the schedule in sched_yield or you'll do the wrong thing.

BTW, (completly unrelated issue) I had a longstanding complain about my
new SMP scheduler code in the current 2.3.x releases (w.r.t. RT/SMP).

Basically with 2.3.x if you have _two_ RT tasks and both are sharing the
preferred CPU, then maybe one of the two RT tasks may not be rescheduled
on an idle CPU. So you may end with two RT tasks in the runqueue, but only
one running and a CPU idle (the other RT tasks is waiting for a
reschedule).

I fixed it at 2.3.15 time:

ftp://ftp.*.kernel.org/pub/linux/kernel/people/andrea/patches/v2.3/2.3.15pre1/SMP-scheduler-RT-1.gz

As the patch is not critical for most people (sure not for me) and it's
only a performance issue, I have not pushed it into 2.3.x yet (but it's
just in my SMP scheduler patch for 2.2.x here:

ftp://ftp.*.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.2/2.2.13pre17aa1/SMP-scheduler-2.2.11-E.gz

)

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/