mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* O(1) scheduler & interactivity improvements
@ 2003-06-22 16:07 Felipe Alfaro Solana
  2003-06-22 20:00 ` Davide Libenzi
  2003-06-23  8:09 ` Helge Hafting
  0 siblings, 2 replies; 26+ messages in thread
From: Felipe Alfaro Solana @ 2003-06-22 16:07 UTC (permalink / raw)
  To: LKML

Hi all,

I must say I'm a little bit disappointed with the interactive feeling of
latest kernels. From what I have read, it seems the scheduler decides on
the "interactive" behavior of a process based on its CPU usage and
sleeping times. I am no kernel expert, so I will assume this is how it
works, more or less, behind the scenes.

I think that marking a process as "interactive" based on the previous
premise is quite unreal. Let's take, for example, a real application
like a word processor which performs background spell checking. The word
processor should be considered interactive, even when it may be hogging
the CPU a lot to perform the background spell check and the rest of its
threads are sleeping waiting for user input.

As someone said before in the list, a process should be marked
"interactive" based on the fact that it's receiving user input, 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), and they have a constant usage of CPU.
However, interactive applications have peaks, requiring shots of CPU for
very short times. However, that's not necessarily true, as I said before
with the example of the word processor: it could well be wasting 100% of
CPU to perform spellchecking but it should still be considered an
interactive application: a single user keystroke should take preference
over the background spellchecking.

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.

However, for X11 based applications it seems a lot more difficult since
all user-based input events are received by the X server itself (and not
the process for which the event is intended). Based on the previous
thoughts, the X11 server would be marked interactive, but not the
application (like the word processor). This is not the desired effect.

So the question is, how can we detect the ultimate process for which the
user input event is intended? Should the X11 server help the scheduler
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
way: when the user changes the focus to a new window, the window owner
is brought into the interactive scheduling class. When the user chooses
a new window, the window which loses the focus forces its owner to
return to the time-shared scheduling class.

What do you think about all of this? Should we use behavior-based
against CPU-usage behavior to decide process interactivity?

Thanks for listening.


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2003-06-30 13:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-22 16:07 O(1) scheduler & interactivity improvements Felipe Alfaro Solana
2003-06-22 20:00 ` Davide Libenzi
2003-06-23 12:50   ` Jesse Pollard
2003-06-23  8:09 ` Helge Hafting
2003-06-23 10:18   ` Felipe Alfaro Solana
2003-06-23 16:21     ` Daniel Gryniewicz
2003-06-23 18:59       ` Felipe Alfaro Solana
2003-06-23 19:21         ` Memory? " Roger Larsson
2003-06-23 16:47     ` Helge Hafting
2003-06-24 18:12       ` Bill Davidsen
2003-06-25 21:41         ` Helge Hafting
     [not found]       ` <5.2.0.9.2.20030624215008.00ce73b8@pop.gmx.net>
2003-06-26  9:59         ` Helge Hafting
2003-06-26 10:39           ` Mike Galbraith
2003-06-26 14:50           ` Bill Davidsen
2003-06-26 23:10           ` Timothy Miller
     [not found]           ` <Pine.LNX.3.96.1030626104733.17562D-100000@gatekeeper.tmr.c om>
2003-06-27  6:36             ` Mike Galbraith
2003-06-27  8:18               ` Helge Hafting
2003-06-27  9:46                 ` Mike Galbraith
2003-06-27 11:39                   ` Helge Hafting
2003-06-27 12:18                     ` Mike Galbraith
2003-06-28  3:51                   ` Bill Davidsen
     [not found]                   ` <Pine.LNX.3.96.1030627234408.25848A-100000@gatekeeper.tmr.c om>
2003-06-28  5:44                     ` Mike Galbraith
2003-06-28 14:34                       ` Helge Hafting
2003-06-29  6:08                         ` Mike Galbraith
2003-06-30 13:37                       ` Bill Davidsen
2003-06-27  6:54           ` jw schultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®