Re: O(1) scheduler & interactivity improvements

Helge Hafting (helgehaf@aitel.hist.no)
Wed, 25 Jun 2003 23:41:19 +0200


On Tue, Jun 24, 2003 at 02:12:20PM -0400, Bill Davidsen wrote:
> On Mon, 23 Jun 2003, Helge Hafting wrote:
>
> > On Mon, Jun 23, 2003 at 12:18:29PM +0200, Felipe Alfaro Solana wrote:
>
> > > I don't consider compiling the kernel an interactive process as it's
> > > done almost automatically without any user intervention. XMMS is not a
> > > complete interactive application as it spends most of the time decoding
> > > and playing sound.
> > >
> > A kernel compile isn't interactive - sure. It may get some boosts
> > anyway for io waiting. This quite correctly puts it above a
> > pure cpu hog like a mandelbrot calculation.
>
> Why? Not why does the scheduler do that, but why *should* a compile be in
> any way more deserving that a Mandelbrot? It isn't obvious to me that
> either are interacting with the user, and if they are it would be the
> Mandelbrot doing realtime display.

This has nothing to do with "interacting with the user", the sleep-based
priority system solves other problems as well. A pure cpu hog
utilizes all the cpu it gets. A compile will end up waiting a lot for io
because it reads input files. This starves the compile, the cpu hog
utilizes all of its timeslices plus the time the compile waits.
This is rectified by giving the compile a boost whenever it waits
(and lets someone else have the cpu). This avoids penalizing processes
just because they do io or lots of io. Readers would otherwise
progress very slowly in the precense of cpu hogs.

Incidentally, this also helps interactivity a lot because interactive
programs tend to wait for user input in the form of io, and when
they get it they get a boost and process the user input quickly.

As for my mandelbrot/compile example - the kernel cannot know
wether you:
* are busy watching fractals and just do a background compile,
or:
* wait for an important compile and pass some time rendering fractals
when the compiler stall reading.

But you can tell it using explicit "nice"

Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/