From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 'select' failure or signal should not update timeout
Date: Thu, 25 Jul 2002 18:15:37 +0100 [thread overview]
Message-ID: <20020725181537.A11324@kushida.apsleyroad.org> (raw)
In-Reply-To: <m1eldrix4f.fsf@frodo.biederman.org>; from ebiederm@xmission.com on Thu, Jul 25, 2002 at 10:35:28AM -0600
Eric W. Biederman wrote:
> When we have a cpu load average < 1, it is trivial to increase the
> timer granularity to something resembling the gettimeofday resolution
> simply by internally doing gettimeofday when schedule is called, and
> adding those processes that have just become runnable to the run
> queue. To get the most out of this the idle task would need to busy
> wait looking for timer events, when we have an event scheduled before
> the next timer tick.
Unfortunately, this does not help "soft real-time" tasks like the
hypothetical video game with a compile running in the background. That
needs to preempt lower priority tasks somehow.
Ideally, because they don't use much CPU but do want to run on time, it
should be possible to run those programs using non-real-time priority,
and they would run on time simply because they always have a high
dynamic priority.
To be fair, although 100Hz timer resolution wasn't good enough even for
a simple "snake" video game with no other load (the eye detects the time
variance as an apparent velocity variance), 1000Hz is probably fine.
> The goal is twofold, to remove the need for user space applications to
> busy wait, so sometimes the system can get something done another
> process is waiting, and to increase the internal kernel timer
> granularity to the point where user space doesn't care anymore. With
> the only timer we sleep past the desired time is when the kernel
> decides there is some higher priority task to run.
What will happen if the timer granularity remains at 1000Hz when
loadavg > 1 is that time-sensitive interactive apps will still busy wait
for the remainder of a tick. _But_, if we can define select() or similar
semantics to mean, as Linus suggested, "wait until at most TIME", then
it becomes possible to avoid the busy wait at low loads (paradoxically).
> The most interesting use I have seen is a high performance local area
> data transfer utility, that would do short sleeps in between sending
> packets to avoid pushing the switch to the point where it would drop
> packets. But it was perfectly fine if a new packet came in before it
> was done waiting for the old packet to go out the wire.
That's the sort of thing I work on :) The resolution required of a
packet shaper is measured in 10s of microseconds, though, so I just
accept that user space must busy wait _all_ the time the link isn't idle.
-- Jamie
next prev parent reply other threads:[~2002-07-25 17:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200207171430.g6HEUvY23619@aztec.santafe.edu>
2002-07-19 9:52 ` Paul Eggert
2002-07-20 0:38 ` Alan Cox
2002-07-20 5:57 ` Linus Torvalds
2002-07-21 15:36 ` Eric W. Biederman
2002-07-24 13:44 ` Jamie Lokier
2002-07-24 18:48 ` Linus Torvalds
2002-07-24 19:07 ` Chris Friesen
2002-07-24 23:30 ` Jamie Lokier
2002-07-25 6:32 ` Rusty Russell
2002-07-25 18:31 ` george anzinger
2002-07-28 5:40 ` David Schwartz
2002-07-25 16:35 ` Eric W. Biederman
2002-07-25 17:15 ` Jamie Lokier [this message]
2002-07-21 16:00 ` Christoph Rohland
2002-07-21 16:43 ` Linus Torvalds
2002-07-21 17:51 ` dean gaudet
2002-07-22 3:59 ` Edgar Toernig
2002-07-22 6:51 ` Christoph Rohland
2002-07-21 16:26 ` Ingo Molnar
2002-07-21 20:14 ` Richard Stallman
2002-07-20 3:59 dank
2002-07-21 3:34 Peter T. Breuer
2002-07-28 10:33 linux
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=20020725181537.A11324@kushida.apsleyroad.org \
--to=lk@tantalophile.demon.co.uk \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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
all inboxes | Powered by JetHome®