Re: SCHED_IDLE patch

MOLNAR Ingo (mingo@chiara.csoma.elte.hu)
Tue, 20 Oct 1998 18:06:11 +0200 (CEST)


On Tue, 20 Oct 1998, Rik van Riel wrote:

> With your patch, goodness() will return -999 on
> every SCHED_IDLE patch; this means that the first
> SCHED_IDLE patch on the runqueue will be selected.

oops, i was thinking about a zero-counter automatically moving the task to
the end of the runqueue. You are right, there is this line missing to make
it complete:

- /* move an exhausted RR process to be last.. */
+ /* move an exhausted RR or SCHED_IDLE process to be last.. */
prev->need_resched = 0;
- if (!prev->counter && prev->policy == SCHED_RR) {
+ if (!prev->counter && prev->policy >= SCHED_RR) {
prev->counter = prev->priority;
move_last_runqueue(prev);
}

this is a straightforward extension.
[the >= thing is ugly, we should rather use bitmasks for scheduling
classes, thus we could do a 'prev->policy & (SCHED_RR | SCHED_IDLE)' to
check with a single branch instruction.

-- mingo

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