Re: scheduling

MOLNAR Ingo (mingo@chiara.csoma.elte.hu)
Fri, 1 May 1998 23:39:49 +0200 (CEST)


On Fri, 1 May 1998, Rik van Riel wrote:

> For some things, you just want to do the O9(nr_tasks)
> stuff. Even if it only was because you need data from
> all processes to do your calculations :-)

not necessarily. Eg., the schedule() for_each_task() thing could be
avoided by saving 'i was scheduled last at' timestamps in
remove_from_runqueue() into struct_task, and fixing up p->counter
'quantums left' in add_to_runqueue(). Both are O(1). This works because
'quantums left' is only needed for runnable processes. The frequency of
calls to add_to_runqueue() is about the same as calls to schedule(), so
it's most probably a win.

this trick works because p->counter 'can be integrated' :), ie. has a
predictable future value even over several iterations.

> (fair swapping can't be done without considering _all_
> processes)

maybe there is a trick for this case too? ;)

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu