All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Dave Jones <davej@codemonkey.org.uk>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, hpa@transmeta.com
Subject: Re: Intel P6 vs P7 system call performance
Date: Tue, 17 Dec 2002 02:53:50 -0800	[thread overview]
Message-ID: <3DFF023E.6030401@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0212162140500.1644-100000@home.transmeta.com>

Linus Torvalds wrote:

> Ok, I did the vsyscall page too, and tried to make it do the right thing
> (but I didn't bother to test it on a non-SEP machine).
> 
> But it might be interesting to verify that a
> recompiled glibc (or even just a preload) really works with this on a
> "whole system" testbed rather than just testing one system call (and not
> even caring about the return value) a million times.


I've created a modified glibc which uses the syscall code for almost
everything.  There are a few int $0x80 left here and there but mostly it
is a centralized change.

The result: all works as expected.  Nice.

On my test machine your little test program performs the syscalls on
roughly twice as fast (HT P4, pretty new).  Your numbers are perhaps for
the P4 Xeons.  Anyway, when measuring some more involved code (I ran my
thread benchmark) I got only about 3% performance increase.  It's doing
a fair amount of system calls.  But again, the good news is your code
survived even this stress test.


The problem with the current solution is the instruction set of the x86.
 In your test code you simply use call 0xfffff000 and it magically work.
 But this is only the case because your program is linked statically.

For the libc DSO I had to play some dirty tricks.  The x86 CPU has no
absolute call.  The variant with an immediate parameter is a relative
jump.  Only when jumping through a register or memory location is it
possible to jump to an absolute address.  To be clear, if I have

    call 0xfffff000

in a DSO which is loaded at address 0x80000000 the jumps ends at
0x7fffffff.  The problem is that the static linker doesn't know the load
address.  We could of course have the dynamic linker fix up the
addresses but this is plain stupid.  It would mean fixing up a lot of
places and making of those pages covered non-sharable.

Instead I've changed the syscall handling to effectve do

   pushl %ebp
   movl $0xfffff000, %ebp
   call *%ebp
   popl %ebp

An alternative is to store the address in a memory location.  But since
%ebx is used for a syscall parameter it is necessary to address the
memory relative to the stack pointer which would mean loading the stack
address with 0xfffff000 before making the syscall.  Not much better than
the code sequence above.

Anyway, it's still an improvement.  But now the question comes up: how
the ld.so detect that the kernel supports these syscalls and can use an
appropriate DSO?  This brings up again the idea of the read-only page(s)
mapped into all processes (you remember).


Anyway, it works nicely.  If you need more testing let me know.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------


  parent reply	other threads:[~2002-12-17 10:46 UTC|newest]

Thread overview: 304+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-09  8:30 Intel P6 vs P7 system call performance Mike Hayward
2002-12-09 15:40 ` erich
2002-12-09 17:48 ` Linus Torvalds
2002-12-09 19:36   ` Dave Jones
2002-12-09 19:46     ` H. Peter Anvin
2002-12-28 20:37       ` Ville Herva
2002-12-29  2:05         ` Christian Leber
2002-12-30 18:22           ` Christian Leber
2002-12-30 21:22             ` Linus Torvalds
2002-12-30 11:29         ` Dave Jones
2002-12-17  0:47     ` Linus Torvalds
2002-12-17  1:03       ` Dave Jones
2002-12-17  2:36         ` Linus Torvalds
2002-12-17  5:55           ` Linus Torvalds
2002-12-17  6:09             ` Linus Torvalds
2002-12-17  6:18               ` Linus Torvalds
2002-12-19 14:03                 ` Shuji YAMAMURA
2002-12-17  6:19               ` GrandMasterLee
2002-12-17  6:43               ` dean gaudet
2002-12-17 16:50                 ` Linus Torvalds
2002-12-17 19:11                 ` H. Peter Anvin
2002-12-17 21:39                   ` Benjamin LaHaise
2002-12-17 21:41                     ` H. Peter Anvin
2002-12-17 21:53                       ` Benjamin LaHaise
2002-12-18 23:53                 ` Pavel Machek
2002-12-19 22:18                   ` H. Peter Anvin
2002-12-19 22:21                     ` Pavel Machek
2002-12-19 22:23                       ` H. Peter Anvin
2002-12-19 22:26                         ` Pavel Machek
2002-12-19 22:30                           ` H. Peter Anvin
2002-12-19 22:34                             ` Pavel Machek
2002-12-19 22:36                               ` H. Peter Anvin
2002-12-17 19:12               ` H. Peter Anvin
2002-12-17 19:26                 ` Martin J. Bligh
2002-12-17 20:51                   ` Alan Cox
2002-12-17 20:16                     ` H. Peter Anvin
2002-12-17 20:49                 ` Alan Cox
2002-12-17 20:12                   ` H. Peter Anvin
2002-12-17  9:45             ` Andre Hedrick
2002-12-17 12:40               ` Dave Jones
2002-12-17 23:18                 ` Andre Hedrick
2002-12-17 15:12               ` Alan Cox
2002-12-18 23:55                 ` Pavel Machek
2002-12-19 22:17                   ` H. Peter Anvin
2002-12-17 10:53             ` Ulrich Drepper [this message]
2002-12-17 11:17               ` dada1
2002-12-17 17:33                 ` Ulrich Drepper
2002-12-17 17:06               ` Linus Torvalds
2002-12-17 17:55                 ` Ulrich Drepper
2002-12-17 18:01                   ` Linus Torvalds
2002-12-17 19:23                   ` Alan Cox
2002-12-17 18:48                     ` Ulrich Drepper
2002-12-17 19:19                       ` H. Peter Anvin
2002-12-17 19:44                       ` Alan Cox
2002-12-17 19:52                         ` Richard B. Johnson
2002-12-17 19:54                           ` H. Peter Anvin
2002-12-17 19:58                           ` Linus Torvalds
2002-12-18  7:20                             ` Kai Henningsen
2002-12-17 18:49                     ` Linus Torvalds
2002-12-17 19:09                       ` Ross Biro
2002-12-17 21:34                       ` Benjamin LaHaise
2002-12-17 21:36                         ` H. Peter Anvin
2002-12-17 21:50                           ` Benjamin LaHaise
2002-12-18 23:59               ` Pavel Machek
2002-12-17 16:12             ` Hugh Dickins
2002-12-17 16:33               ` Richard B. Johnson
2002-12-17 17:47                 ` Linus Torvalds
2002-12-17 16:54               ` Hugh Dickins
2002-12-17 17:07               ` Linus Torvalds
2002-12-17 17:19                 ` Matti Aarnio
2002-12-17 17:55                   ` Linus Torvalds
2002-12-17 18:24                     ` Linus Torvalds
2002-12-17 18:33                       ` Ulrich Drepper
2002-12-17 18:30                     ` Ulrich Drepper
2002-12-17 19:04                       ` Linus Torvalds
2002-12-17 19:19                         ` Ulrich Drepper
2002-12-17 19:28                         ` Linus Torvalds
2002-12-17 19:32                           ` H. Peter Anvin
2002-12-17 19:44                             ` Linus Torvalds
2002-12-17 19:53                           ` Ulrich Drepper
2002-12-17 20:01                             ` Linus Torvalds
2002-12-17 20:17                               ` Ulrich Drepper
2002-12-18  4:15                                 ` Linus Torvalds
2002-12-18  4:15                               ` Linus Torvalds
2002-12-18  4:39                                 ` H. Peter Anvin
2002-12-18  4:49                                   ` Linus Torvalds
2002-12-18  6:38                                     ` Linus Torvalds
2002-12-18 13:17                                 ` Richard B. Johnson
2002-12-18 13:40                                 ` Horst von Brand
2002-12-18 13:47                                   ` Sean Neakums
2002-12-18 14:10                                     ` Horst von Brand
2002-12-18 14:51                                       ` dada1
2002-12-18 19:12                                       ` Mark Mielke
2002-12-18 15:52                                   ` Alan Cox
2002-12-18 16:41                                   ` Dave Jones
2002-12-18 16:49                                     ` Freezing.. (was Re: Intel P6 vs P7 system call performance) Linus Torvalds
2002-12-18 16:56                                       ` Larry McVoy
2002-12-18 16:58                                       ` Dave Jones
2002-12-18 17:41                                         ` Linus Torvalds
2002-12-18 18:03                                           ` Jeff Garzik
2002-12-18 18:09                                             ` Mike Dresser
2002-12-23 12:34                                               ` Kai Henningsen
2002-12-18 19:08                                           ` Alan Cox
2002-12-18 19:23                                             ` Larry McVoy
2002-12-18 19:30                                               ` Alan Cox
2002-12-18 19:33                                                 ` Larry McVoy
2002-12-18 19:42                                                   ` Alan Cox
2002-12-18 19:45                                                     ` Larry McVoy
2002-12-18 20:39                                                       ` John Bradford
2002-12-18 22:08                                                         ` Larry McVoy
2002-12-18 22:37                                                           ` John Bradford
2002-12-19  1:09                                                             ` Alan Cox
2002-12-19  0:37                                                               ` Russell King
2002-12-19  0:58                                                                 ` Jeff Garzik
2002-12-19  1:43                                                                 ` Martin J. Bligh
2002-12-19 10:50                                                                 ` Dave Jones
2002-12-19  0:59                                                               ` John Bradford
2002-12-19 10:27                                                                 ` Dave Jones
2002-12-19  1:17                                                               ` Linus Torvalds
2002-12-19  0:08                                                           ` Alan Cox
2002-12-19  0:53                                                             ` John Bradford
2002-12-19 13:17                                                           ` Stephen Satchell
2002-12-19  5:34                                             ` Timothy D. Witham
2002-12-19  6:43                                               ` Andrew Morton
2002-12-19  5:45                                                 ` Timothy D. Witham
2002-12-19  7:05                                               ` Martin J. Bligh
2002-12-19  6:08                                                 ` Timothy D. Witham
2002-12-18 19:50                                           ` Oliver Xymoron
2002-12-18 17:06                                       ` Eli Carter
2002-12-18 17:08                                       ` Andrew Morton
2002-12-18 18:25                                       ` John Alvord
2002-12-18 18:41                                     ` Intel P6 vs P7 system call performance Horst von Brand
2002-12-17 19:26                       ` Alan Cox
2002-12-17 18:57                         ` Ulrich Drepper
2002-12-17 19:10                           ` Linus Torvalds
2002-12-17 19:21                             ` H. Peter Anvin
2002-12-17 19:37                               ` Linus Torvalds
2002-12-17 19:43                                 ` H. Peter Anvin
2002-12-17 20:07                                   ` Matti Aarnio
2002-12-17 20:10                                     ` H. Peter Anvin
2002-12-17 19:59                                 ` Matti Aarnio
2002-12-17 20:06                                 ` Ulrich Drepper
2002-12-17 20:35                                   ` Daniel Jacobowitz
2002-12-18  0:20                                   ` Linus Torvalds
2002-12-18  0:38                                     ` Ulrich Drepper
2002-12-18  7:41                                 ` Kai Henningsen
2002-12-18 13:00                                 ` Rogier Wolff
2002-12-17 19:47                             ` Dave Jones
2002-12-18 12:57                             ` Rogier Wolff
2002-12-19  0:14                               ` Pavel Machek
2002-12-17 21:38                           ` Benjamin LaHaise
2002-12-17 21:41                             ` H. Peter Anvin
2002-12-17 18:39                     ` Jeff Dike
2002-12-17 19:05                       ` Linus Torvalds
2002-12-18  5:34                     ` Jeremy Fitzhardinge
2002-12-18  5:38                       ` H. Peter Anvin
2002-12-18 15:50                       ` Alan Cox
2002-12-18 23:51             ` Pavel Machek
2002-12-13 15:45 ` William Lee Irwin III
2002-12-13 16:49   ` Mike Hayward
2002-12-14  0:55     ` GrandMasterLee
2002-12-14  4:41       ` Mike Dresser
2002-12-14  4:53         ` Mike Dresser
2002-12-14 10:01           ` Dave Jones
2002-12-14 17:48             ` Mike Dresser
2002-12-14 18:36             ` GrandMasterLee
2002-12-15  2:03               ` J.A. Magallon
2002-12-15 21:59   ` Pavel Machek
2002-12-15 22:37     ` William Lee Irwin III
2002-12-15 22:43       ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2003-01-10 18:08 Gabriel Paubert
2002-12-30 13:06 Manfred Spraul
2002-12-30 14:54 ` Andi Kleen
2002-12-22 15:45 Nakajima, Jun
2002-12-22 12:33 Mikael Pettersson
2002-12-22 16:00 ` Jamie Lokier
2002-12-19 18:46 billyrose
2002-12-19 16:10 billyrose
2002-12-19 15:20 bart
2002-12-19 14:57 bart
2002-12-19 14:40 billyrose
2002-12-19 15:11 ` Richard B. Johnson
2002-12-19 13:55 bart
2002-12-19 19:37 ` Linus Torvalds
2002-12-19 22:10   ` Jamie Lokier
2002-12-19 22:16     ` H. Peter Anvin
2002-12-19 22:22     ` Linus Torvalds
2002-12-19 22:26       ` H. Peter Anvin
2002-12-19 22:49         ` Linus Torvalds
2002-12-19 23:30           ` Linus Torvalds
2002-12-22 11:08       ` James H. Cloos Jr.
2002-12-22 18:49         ` Linus Torvalds
2002-12-22 19:07           ` Ulrich Drepper
2002-12-22 19:34             ` Linus Torvalds
2002-12-22 19:51               ` Ulrich Drepper
2002-12-22 20:50                 ` James H. Cloos Jr.
2002-12-22 20:56                   ` Ulrich Drepper
2002-12-22 19:17           ` Ulrich Drepper
2002-12-20 10:08   ` Ulrich Drepper
2002-12-20 12:06     ` Jamie Lokier
2002-12-20 16:47       ` Linus Torvalds
2002-12-20 23:38         ` Jamie Lokier
2002-12-20 23:50           ` H. Peter Anvin
2002-12-21  0:09           ` Linus Torvalds
2002-12-21 17:18             ` Jamie Lokier
2002-12-21 19:39               ` Linus Torvalds
2002-12-22  2:18                 ` Jamie Lokier
2002-12-22  3:11                   ` Linus Torvalds
2002-12-22 10:13                     ` Ingo Molnar
2002-12-22 15:32                       ` Jamie Lokier
2002-12-22 18:53                       ` Linus Torvalds
2002-12-23  5:03                         ` Linus Torvalds
2002-12-23  7:14                           ` Ulrich Drepper
2002-12-23 23:27                           ` Petr Vandrovec
2002-12-24  0:22                             ` Stephen Rothwell
2002-12-24  4:10                               ` Linus Torvalds
2002-12-24  8:05                                 ` Rogier Wolff
2002-12-24 18:51                                   ` Linus Torvalds
2002-12-24 21:10                                     ` Rogier Wolff
2002-12-27 16:14                                 ` Kai Henningsen
2002-12-24 19:36                       ` Linus Torvalds
2002-12-24 20:20                         ` Ingo Molnar
2002-12-24 20:27                           ` Linus Torvalds
2002-12-24 20:31                         ` Ingo Molnar
2002-12-24 20:39                           ` Linus Torvalds
2002-12-28  2:05                             ` H. Peter Anvin
2002-12-28  2:04                           ` H. Peter Anvin
2002-12-26  7:47                         ` Pavel Machek
2003-01-10 11:30                         ` Gabriel Paubert
2003-01-10 17:11                           ` Linus Torvalds
2002-12-22 10:23                     ` Ingo Molnar
2002-12-19 13:22 bart
2002-12-19 13:38 ` Dave Jones
2002-12-19 14:22   ` Jamie Lokier
2002-12-19 16:56     ` Dave Jones
2002-12-19 19:29 ` H. Peter Anvin
2002-12-18 23:51 billyrose
2002-12-19 13:10 ` Richard B. Johnson
2002-12-18 12:55 Terje Eggestad
2002-12-18 20:14 ` H. Peter Anvin
2002-12-18 20:25   ` Richard B. Johnson
2002-12-18 20:26     ` H. Peter Anvin
2002-12-18 22:28   ` Jamie Lokier
2002-12-18 22:37     ` Linus Torvalds
2002-12-18 22:57       ` Linus Torvalds
2002-12-20  0:53         ` Daniel Jacobowitz
2002-12-20  1:47           ` Linus Torvalds
2002-12-20  2:37             ` Daniel Jacobowitz
2002-12-18 22:39     ` H. Peter Anvin
2002-12-18  1:30 Nakajima, Jun
2002-12-18  1:54 ` Ulrich Drepper
2002-12-18  3:36   ` H. Peter Anvin
2002-12-18  4:05     ` Linus Torvalds
2002-12-18  4:36       ` H. Peter Anvin
2002-12-18  4:07     ` Linus Torvalds
2002-12-18  4:40       ` Stephen Rothwell
2002-12-18  4:52         ` Linus Torvalds
2002-12-18  4:53         ` Andrew Morton
2002-12-18 19:12         ` Andrew Morton
2002-12-18 23:45       ` Pavel Machek
2002-12-20  3:05         ` Alan Cox
2002-12-20  4:03           ` Stephen Rothwell
2002-12-18  6:00   ` Brian Gerst
2002-12-17 16:32 Manfred Spraul
2002-12-17 17:13 ` Richard B. Johnson
2002-12-17 17:19   ` Richard B. Johnson
2002-12-17 17:37     ` Mikael Pettersson
2002-12-17 16:14 John Reiser
2002-12-17 16:01 John Reiser
     [not found] <20021209193649.GC10316@suse.de.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0212161639310.1623-100000@penguin.transmeta.com.suse.lists.linux.kernel>
2002-12-17  8:56   ` Andi Kleen
2002-12-17 16:57     ` Linus Torvalds
2002-12-18  5:25       ` Brian Gerst
2002-12-18  6:06         ` Linus Torvalds
2002-12-21 11:24           ` Ingo Molnar
2002-12-21 17:28             ` Jamie Lokier
2002-12-21 16:07         ` Christian Leber
2002-12-15  8:43 scott thomason
2002-12-15  4:06 Albert D. Cahalan
2002-12-15 22:01 ` Pavel Machek
2002-12-16  7:33   ` Albert D. Cahalan
2002-12-16 11:17     ` Pavel Machek
2002-12-16 17:54       ` Mark Mielke
2002-12-16 16:07         ` Jonah Sherman
2002-12-17  4:10           ` David Schwartz
2002-12-17  8:02         ` Helge Hafting
2002-12-16 19:55       ` H. Peter Anvin
2002-12-13 21:52 Margit Schubert-While
2002-12-13 19:32 Dieter Nützel
2002-12-13 17:51 Margit Schubert-While
2002-12-11 12:48 Terje Eggestad
2002-12-11 18:50 ` H. Peter Anvin
2002-12-12  9:42   ` Terje Eggestad
2002-12-12 10:06     ` Arjan van de Ven
2002-12-12 10:31       ` Terje Eggestad
2002-12-12 19:03       ` H. Peter Anvin
2002-12-12 20:36     ` Mark Mielke
2002-12-12 20:56       ` J.A. Magallon
2002-12-12 20:12         ` Zac Hansen
2002-12-13  9:21         ` Terje Eggestad
2002-12-13 15:58           ` Ville Herva
2002-12-13 21:57             ` Terje Eggestad
2002-12-13 22:53               ` H. Peter Anvin
2002-12-12 20:56       ` Vojtech Pavlik
2002-12-09  7:01 Samium Gromoff

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=3DFF023E.6030401@redhat.com \
    --to=drepper@redhat.com \
    --cc=davej@codemonkey.org.uk \
    --cc=hpa@transmeta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.