linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: rob@landley.net
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] O13int for interactivity
Date: Tue, 12 Aug 2003 21:08:54 +1000	[thread overview]
Message-ID: <3F38CAC6.7010808@cyberone.com.au> (raw)
In-Reply-To: <200308120629.31476.rob@landley.net>



Rob Landley wrote:

>On Monday 11 August 2003 22:51, Nick Piggin wrote:
>
>>Rob Landley wrote:
>>
>>>On Tuesday 05 August 2003 06:32, Nick Piggin wrote:
>>>
>>>>But by employing the kernel's services in the shape of a blocking
>>>>syscall, all sleeps are intentional.
>>>>
>>>Wrong.  Some sleeps indicate "I have run out of stuff to do right now, I'm
>>>going to wait for a timer or another process or something to wake me up
>>>with new work".
>>>
>>>
>>>
>>>Some sleeps indicate "ideally this would run on an enormous ramdisk
>>>attached to gigabit ethernet, but hard drives and internet connections
>>>are just too slow so my true CPU-hogness is hidden by the fact I'm
>>>running on a PC instead of a mainframe."
>>>
>>I don't quite understand what you are getting at, but if you don't want to
>>sleep you should be able to use a non blocking syscall.
>>
>
>So you can then block on poll instead, you mean?
>

Well if thats what you intend, yes. Or set poll to be non-blocking.

>
>>But in some cases
>>I think there are times when you may not be able to use a non blocking
>>call.
>>
>>And if a process is a CPU hog, its a CPU hog. If its not its not. Doesn't
>>matter how it would behave on another system.
>>
>
>Audio playback, video playback, animated gifs in your web browser, and even 
>first person shooters have built in rate limiting.  (Okay, games can go to an 
>insanely high framerate, but usually they achieve "good enough" and are happy 
>with that unless you're doing a benchmark with them.)
>
>There is a certain rate of work they do, and if they can manage that they stop 
>working.  On a system with twice as much CPU power and disks twice as fast, 
>kmail shouldn't use significantly more CPU keeping up with my typing.  These 
>are "interactive" tasks.
>
>Bug gzip, tar, gcc, and most cron jobs, are a different type of task.  They 
>have nobuilt-in rate limiting.  On a system with twice as much CPU and disks 
>twice as fast, they finish twice as quickly.  They never voluntarily go idle 
>until they exit; when they're idle it just means they hit a bottleneck.  The 
>system can never be "fast enough" that these quiesce themselves for a while 
>because they've run out of work just now.
>
>These are hogs, often both of CPU time and I/O bandwidth.  Being blocked on 
>I/O does not stop them from being hogs, it just means they're juggling their 
>hoggishness.
>

This is the CPU scheduler though. A program could be a disk/network
hog and use a few % cpu. Its obviously not a cpu hog, and should get
the cpu again soon after it is woken. Sooner than non running cpu hogs,
anyway.

>
>An mpeg player has times when it's neither blocked on CPU or on I/O, it's 
>waiting until it's time to display the next frame.
>
>Now some of this could be viewed as a spooler problem, where there's a slow 
>output device (the screen, the sound card, etc) and if you wanted to you 
>could precompute stuff into a big memory wasting buffer and then instead of 
>skipping because you're not getting scheduled fast enough you're skipping 
>because your precomputed buffer got swapped to disk.  But the difference here 
>is that xmms or  xine could do their output generation much faster than they 
>are, if they wanted to.  The output device could be sped up.  Your animated 
>gif can cycle too fast to see, you can fast-forward through your movie, you 
>can play an mpeg so it sounds like chip and dale on helium...  But they 
>don't, they intentionally rate limit the output, and what they want in return 
>is low latency when the rate limiting is up.
>
>When you're rate limiting the output, you want to accurately control the rate.  
>You don't want it to be too fast (timers are great at this), and you don't 
>want it to be too slow (you get skips or miss frames).
>
>That's what Con's detecting.  It's a heuristic.  But it's a good heuristic.  A 
>process that plays nice and yields the CPU regularly gets a priority boost.  
>(That's always BEEN a heuristic.)
>
>The current scheduler code has moved a bit beyond this, but this is the bit I 
>was talking about when I disagreed with you earlier.
>

Yeah, I know Con is trying to detect this. Its just that detecting
it using TASK_INTERRUPTIBLE/TASK_UNINTERRUPTIBLE may not be the best
way. Suddenly your kernel compile on an NFS mount becomes interactive
for example. Then again, the way things are, Con might not have any
other option.

Mostly I agree with what you've said above.



  reply	other threads:[~2003-08-12 11:09 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 16:07 [PATCH] O13int for interactivity Con Kolivas
2003-08-04 18:24 ` Felipe Alfaro Solana
2003-08-04 19:15 ` Antonio Vargas
2003-08-04 21:32   ` Con Kolivas
2003-08-04 20:11 ` Mike Galbraith
2003-08-04 22:11   ` Con Kolivas
2003-08-05  7:10     ` Mike Galbraith
2003-08-05  2:11 ` Nick Piggin
2003-08-05  2:20   ` Con Kolivas
2003-08-05  2:21     ` Nick Piggin
2003-08-05  3:06       ` Con Kolivas
2003-08-05  3:17         ` Nick Piggin
2003-08-06 18:48           ` Interactivity improvements Timothy Miller
2003-08-06 19:01             ` Mike Fedyk
2003-08-06 20:09             ` Helge Hafting
2003-08-06 21:15             ` Con Kolivas
2003-08-05  3:18       ` [PATCH] O13int for interactivity Con Kolivas
2003-08-05  3:31         ` Nick Piggin
2003-08-05  5:04           ` Con Kolivas
2003-08-05  5:12             ` Nick Piggin
2003-08-05  5:16               ` Con Kolivas
2003-08-05  5:28                 ` Nick Piggin
2003-08-05 10:22                   ` Con Kolivas
2003-08-05 10:32                     ` Nick Piggin
2003-08-05 10:45                       ` Con Kolivas
2003-08-05 10:48                         ` Nick Piggin
2003-08-05 10:56                           ` Con Kolivas
2003-08-05 11:03                             ` Nick Piggin
2003-08-05 11:12                               ` Con Kolivas
2003-08-05 11:23                                 ` Nick Piggin
2003-08-05 11:34                                   ` Con Kolivas
2003-08-05 10:54                         ` Arjan van de Ven
2003-08-05 11:10                           ` Con Kolivas
2003-08-06 21:33                       ` Timothy Miller
2003-08-06 21:33                         ` Con Kolivas
2003-08-07  0:27                           ` Timothy Miller
2003-08-07  0:27                             ` Con Kolivas
2003-08-07  0:44                               ` Timothy Miller
2003-08-11  6:48                       ` Rob Landley
2003-08-11 15:47                         ` William Lee Irwin III
2003-08-12  2:51                         ` Nick Piggin
2003-08-12  6:16                           ` Mike Galbraith
2003-08-12  7:07                             ` Nick Piggin
2003-08-12  7:18                               ` Nick Piggin
2003-08-12  9:42                                 ` Mike Galbraith
2003-08-12 21:11                                   ` Mike Fedyk
2003-08-13  6:55                                     ` Mike Galbraith
2003-08-12  9:22                               ` Mike Galbraith
2003-08-12  9:37                                 ` Nick Piggin
2003-08-12  9:48                                   ` Mike Galbraith
2003-08-12 10:29                           ` Rob Landley
2003-08-12 11:08                             ` Nick Piggin [this message]
2003-08-12 11:35                               ` Rob Landley
2003-08-12 11:58                                 ` Nick Piggin
2003-08-13  2:08                                   ` jw schultz
2003-08-13  3:07                                     ` Gene Heskett
2003-08-13  3:24                                       ` Nick Piggin
2003-08-13  5:24                                         ` Gene Heskett
2003-08-13  5:43                                           ` Andrew McGregor
2003-08-13 12:33                                             ` Gene Heskett
2003-08-14  5:03                                               ` Andrew McGregor
2003-08-14 10:48                                                 ` Gene Heskett
2003-08-12 15:36                           ` Timothy Miller
2003-08-05  6:03             ` Andrew Morton
2003-08-05  7:26               ` Con Kolivas
2003-08-05  8:12                 ` Oliver Neukum
2003-08-05  8:20                   ` Con Kolivas
2003-08-05  8:27                     ` Mike Galbraith
2003-08-05  8:43                       ` Con Kolivas
2003-08-05  9:09                         ` Mike Galbraith
2003-08-05  9:19                           ` Con Kolivas
2003-08-05 10:04                   ` Nick Piggin
2003-08-11  6:57                 ` Rob Landley
2003-08-11 15:58                   ` William Lee Irwin III
2003-08-05  7:53               ` Mike Galbraith
     [not found] <gQ4n.5oS.7@gated-at.bofh.it>
     [not found] ` <jUl6.5eh.1@gated-at.bofh.it>
     [not found]   ` <jUuT.5kZ.15@gated-at.bofh.it>
     [not found]     ` <jWn1.6K1.11@gated-at.bofh.it>
2003-08-13 13:48       ` Pascal Schmidt
2003-08-13 14:50         ` Gene Heskett
  -- strict thread matches above, loose matches on Subject: below --
2003-08-06 10:35 Voluspa
2003-08-04 19:12 Voluspa
2003-07-27 15:12 [PATCH] O10int " Con Kolivas
2003-07-28 18:08 ` Valdis.Kletnieks
2003-07-28 18:40   ` Andrew Morton
2003-08-04 18:51     ` [PATCH] O13int " Felipe Alfaro Solana
2003-08-04 18:58       ` Felipe Alfaro Solana
2003-08-04 21:46         ` Con Kolivas
2003-08-04 22:16           ` Felipe Alfaro Solana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F38CAC6.7010808@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).