> Currently, 2.5 kernels don't have a good "interactive" kernel, if we
> stick to the previous definition of "interactive". I can easily starve
> processes (XMMS) and moving windows around the screen do feel jerky and
> laggy at best when the machine is loaded. For a normal desktop usage, I
> prefer all my intensive tasks to start releasing more CPU cycles so
> moving a window around the desktop feels completely smooth (sorry to
> say, as Windows does). The same applies to repainting, or even launching
> a new process.
>
I don't say the current 2.5 kernel is perfect - but I do
believe the current scheme (sleep-based priority) is good.
2.5 may need some tweaking to get good, such as:
* how much boost for how much sleep
* how long do you keep the boost
> > > for example, key strokes, mouse movements or any events received from any
> > > input device, not based on its CPU usage. I think applications like XMMS
> > > or mplayer shouldn't be considered interactive (at least, not until they
> > > start interacting with user),
>
> > The're interactive if the user is staring at / listening to the output.
>
> Or the user is feeding events to it, for example, by dragging a window,
> clicking the mouse or pressing keys. If a process has received user
> input in the past, ir's pretty probable that the process is an
> interactive one.
>
Except for when the user starts a cpu hog, which really is
almost all cpu hogs. :-/
> 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.
> > Use a multithreaded word processor and you'll get exactly this behaviour,
> > with the current system. See above.
>
> I agree. The word processor example was a bad one. Most word processors
> are multithreaded.
>
> > > For terminal based, interactive applications (like pine, vi, and
> > > company), which are connected to tty devices, a user input event could
> > > make the scheduler boost the process priority for a brief time (and
> > > then, reduce the priority in a nearly quadratic fashion until reaching
> > > it's original, or a lower, priority) to give it a better response time
> > > and increase the interactive feeling.
> > >
> > This works already, because the app slept waiting for that keystroke.
>
> So then, why I can easily starve the X11 server (which should be marked
> interactive), Evolution or OpenOffice simply by running "while true; do
> a=2; done". Why don't they get an increased priority boost to stop the
> from behaving so jerky?
>
A badly implemented or ill-tuned scheduler. The loop isn't interactive.
Openoffice is a bad example though - it has _so_ much overhead
during startup that it seems to (correctly) become noninteractive.
> > > by increasing the target process priority (it normally runs as root)?
> > > Should the window manager increase the priority of the process which
> > > owns the current foreground, active window? Solaris seems to work this
> >
> > It can't without that X protocol change, for the "foreground process",
> > the "window manager" and the "X server" may all be running on three
> > different machines.
>
> That's what is said at course SA-400 Solaris 8 Tuning from the Solaris
> Official Curriculum. In fact, it works when working locally on a Solaris
> 8 or 9 machine.
Sure, you can do this locally, but that is not enough. Being fair is
important, particularly in multi-user situations. And multi-user becomes
_more_ common now that corporations realize they can save costs by
having 2-4 users share a single pc. (Duplicate screens & keyboard, but
not the rest.) Then there's remote login for administration,
spreading a large job over many pc's and so on.
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/