Re: [SHED] Questions.

From: Ian Kumlien
Date: Mon Sep 01 2003 - 18:06:05 EST


[Forgot CC to LKML and Robert Love, sorry ]

On Mon, 2003-09-01 at 17:07, Daniel Phillips wrote:
> On Monday 01 September 2003 01:41, Robert Love wrote:
> > Priority inversion is bad, but the priority inversion in this case is
> > intended. Higher priority tasks cannot starve lower ones. It is a
> > classic Unix philosophy that 'all tasks make some forward progress'
>
> So if I have 1000 low priority tasks and one high priority task, all CPU
> bound, the high priority task gets 0.1% CPU. This is not the desirable or
> expected behaviour.

> My conclusion is, the strategy of expiring the whole active array before any
> expired tasks are allowed to run again is incorrect. Instead, each active
> list should be refreshed from the expired list individually. This does not
> affect the desirable O(1) scheduling property. To prevent low priority
> starvation, the high-to-low scan should be elaborated to skip some runnable,
> high priority tasks occasionally in a *controlled* way.

I like this idea.
You could handle the priority starvation with a "old process" boost.
(i don't know which would be simpler or if there is something even
simpler out there)

This would ensure that all processes are run sooner or later. Real
cpuhogs would run very seldom due to being starved, but run when they
get the boost. On a loaded system this might be desirable since most
login tools would be "normal" or "high pri" from the get go.
(there might be a problem with locks though)

This should also work hand in hand with timeslice changes imho. Aswell
as process preemption. If we assume that cpu hogs has work that they
want to get done, let em do it for as long as possible. If something
"important" happens, it'll be preempted right?

> IMHO, this minor change will provide a more solid, predictable base for Con
> and Nick's dynamic priority and dynamic timeslice experiments.

Most definitely.

--
Ian Kumlien <pomac@xxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part