Re: SCHED_IDLE patch

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Tue, 20 Oct 1998 18:35:50 +0200 (CEST)


On Tue, 20 Oct 1998, MOLNAR Ingo wrote:

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

I fixed it differently in my patch. Could you please
review it in order to compare the two and crush my
version based on an honest comparison ;)

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

That won't work. (SCHED_RR | SCHED_IDLE) = 0x3; SCHED_FIFO = 0x1.
Well, that basically would mean breaking SCHED_FIFO semantics ;))

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

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