mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jg@pa.dec.com (Jim Gettys)
To: dean gaudet <dean-list-linux-kernel@arctic.org>
Cc: Jeff Garzik <jgarzik@mandrakesoft.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: X15 alpha release: as fast as TUX but in user space (fwd)
Date: Sun, 29 Apr 2001 14:16:43 -0700 (PDT)	[thread overview]
Message-ID: <200104292116.f3TLGhu07016@pachyderm.pa.dec.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0104290914260.14261-100000@twinlark.arctic.org>

The "put the time into a magic location in shared memory" goes back, as
far as I know, to Bob Scheifler or myself for the X Window System, sometime
around 1984 or 1985: we put it into a page of shared memory where we used
a circular buffer scheme to put input events (keyboard/mice), so that
we could avoid the read system call overhead to get these events (and
more importantly, check between each request if there was input to
process).  I don't think we ever claimed it was novel, just that we did
it that way (I'd have to ask Bob if he had heard of that before we did
it).  We put it into the same piece of memory we put the circular event
buffer, avoiding both the get-time-of day calls, but also the much more
expensive reads that would have been required (we put the events into a
circular buffer, with the kernel only updating one value, and user space
updating the other value defining the circular buffer).

In X, it is important for interactivity to get input events and send them
to clients ASAP: just note the effect of Keith Packard's recent implementation
of "silken mouse", where signals are used to deliver events to the X server.
This finally has made mouse tracking (done in user space on Linux; generally
done by kernel drivers on most UNIX boxes) what we were getting on 1 mip machines
under load (Keith has also done more than this with his new internal X
scheduler, which prevents clients from monopolizing the X server anywhere
like the old implementation).

This shared memory technique is very powerful to allow a client application to know if
it needs to do a system call, and is very useful for high performance servers
(like X), where a system call is way too expensive.

I've certainly mentioned this technique in the past in the Web community
(but HTTP servers are processing requests about 1/100-1/1000 the rate of
an X server, which gets into the millions of requests/second on current machines.

So if you want to get user space to really go fast, sometimes you resort
to such trickery....  I think the technique has real value: the interesting
question is should there be general kernel facilities to make this easy
(we did it via ugly hacks on VAX and MIPS boxes) for kernel facilities
to provide.

"X is an exercise in avoiding system calls".  I think I said this around
1984-1985.  
				- Jim

--
Jim Gettys
Technology and Corporate Development
Compaq Computer Corporation
jg@pa.dec.com


  parent reply	other threads:[~2001-04-29 21:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-28 15:52 Ingo Molnar
2001-04-28 19:53 ` Andi Kleen
2001-04-28 22:56 ` Richard Gooch
2001-04-29  5:13   ` H. Peter Anvin
2001-04-29 11:14     ` Jeff Garzik
2001-04-29 16:21       ` dean gaudet
2001-04-29 20:19         ` H. Peter Anvin
2001-04-29 21:16         ` Jim Gettys [this message]
2001-04-29 21:40           ` H. Peter Anvin
2001-04-29 21:47             ` Jim Gettys
2001-05-02 18:18           ` Matti Aarnio
2001-05-02 19:34             ` Linus Torvalds
2001-05-02 20:55               ` Fabio Riccardi
2001-04-29 22:29         ` Richard Gooch
2001-04-30  7:02       ` David S. Miller
2001-04-30  7:29         ` H. Peter Anvin
2001-04-30  7:51         ` David S. Miller
2001-04-30 14:56         ` Jonathan Lundell
2001-04-29 11:27     ` David S. Miller
2001-04-29 13:32       ` Ingo Oeser
2001-04-29 18:48       ` Richard Gooch
2001-04-29 18:55         ` Gregory Maxwell
2001-04-29 19:02         ` Richard Gooch
2001-04-29 19:47           ` Gregory Maxwell
2001-04-29 19:54           ` Richard Gooch
2001-04-29 20:11         ` Ingo Oeser
2001-04-29 20:18           ` Gregory Maxwell
2001-04-30  0:13             ` Andrea Arcangeli
2001-04-29 20:45           ` Arjan van de Ven
2001-04-29 22:20           ` Richard Gooch
2001-04-30 16:46           ` Alan Cox
2001-04-29 22:18         ` Richard Gooch
2001-04-29 19:38       ` Jamie Lokier
2001-04-29 23:53         ` Andrea Arcangeli
2001-04-30  8:42     ` Pavel Machek
2001-05-03  7:13       ` Kai Henningsen
2001-05-03  7:44         ` Keith Owens
2001-05-03 10:37           ` Ingo Oeser
2001-05-03 15:44           ` Gregory Maxwell
2001-05-07 19:04           ` Pavel Machek
2001-05-03  9:37         ` Alan Cox
2001-05-07 19:03           ` vsyscalls [was Re: X15 alpha release: as fast as TUX but in user space (fwd)] Pavel Machek
2001-05-03 12:23       ` X15 alpha release: as fast as TUX but in user space (fwd) Helge Hafting
2001-05-03 19:09         ` Pavel Machek
2001-05-03 19:50           ` agrawal
2001-05-07 19:07             ` vsyscallRe: " Pavel Machek
2001-05-03 20:19           ` Alan Cox
2001-05-03 20:41             ` Gregory Maxwell
2001-05-04  8:06               ` Pavel Machek
2001-05-04 17:31                 ` dean gaudet
2001-05-04  8:43             ` bert hubert
2001-05-02 10:52   ` Andi Kleen
2001-05-02 10:53     ` Ingo Molnar

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=200104292116.f3TLGhu07016@pachyderm.pa.dec.com \
    --to=jg@pa.dec.com \
    --cc=dean-list-linux-kernel@arctic.org \
    --cc=hpa@zytor.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®