mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: Ulrich Drepper <drepper@redhat.com>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] linux-2.6.2-rc2_vsyscall-gtod_B1.patch
Date: Thu, 29 Jan 2004 15:59:55 -0800	[thread overview]
Message-ID: <1075420794.1592.162.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <20040129191500.GA1027@mail.shareable.org>

On Thu, 2004-01-29 at 11:15, Jamie Lokier wrote:
> Ulrich Drepper wrote:
> > And they require the syscall stubs to suddenly set up the usual PIC
> > infrastructure since a jump through the PLT is used.
> 
> As this is x86, can't the syscall routines in Glibc call directly
> without a PLT entry?  With prelinking, because the vdso is always
> located at the same address, there isn't even a dirty page overhead to
> using non-PIC in this case.
> 
> > This is much slower than the extra indirection the vdso could do.
> 
> If you have to use a PLT entry it is.  If you can do it without a PLT,
> direct jump to the optimised syscall address is fastest.
> 
> > The vdso is just one of the DSOs in the search path and usually the very
> > last.  So there would be possible many objects which are looked at
> > first, unsuccessfully.
> 
> Being Glibc, you could always tweak ld.so to only look at the last one
> if this were really a performance issue.  Btw, every syscall used by
> the program requires at least one symbol lookup, usually over the
> whole search path, anyway.
> 
> > And another problem I should have mentioned last night: in statically
> > linked applications the vDSO isn't used this way.  Do dynamic linker
> > functionality is available.  We find the vDSO through the auxiliary
> > vector and use the absolute address, not the symbol table of the vDSO.
> > If the syscall entry in the vDSO would do the dispatch automatically,
> > statically linked apps would benefit from the optimizations, too.
> > Otherwise they are left out.
> 
> I hear what you're saying.  These are the things which bother me:
> 
>    1. There are already three indirect jumps to make a syscall.
>       (PLT to libc function, indirect jump to vsyscall entry, indirect
>       jump inside kernel).  Another is not necessary (in fact two of
>       those aren't necessary either), why add more?
> 
>    2. Table makes the stub for all syscalls slower.
> 
> All this is moot, though, because in reality only very few syscalls
> will be optimised, and it doesn't really matter if an older Glibc
> doesn't take advantage of a newer kernel's optimised version.  If
> someone would like the performance, installing an up to date Glibc is
> no big deal.
> 
> So pragmatically John's solution, with Glibc looking in the vdso just
> for syscalls it knows have an optimised implementation (i.e. just
> gettimeofday so far), is best IMHO.

[Head spins] Forgive me, but my glibc/linker knowledge is minimal, so
I'm mostly guessing at the meaning of your comments above. 

The picture in my mind is:

Ulrich is suggesting the vsyscall-sysenter code be extended to such that
it switches on the syscall number and jumps to the vsyscall-gettimeofday
code when appropriate. This avoids having to change glibc. 

Jamie is suggesting that the extra indirection
glibc->sysenter->vgettimeofday could be simply cut down to
glibc->vgettimeofday. This requires changing glibc, but would be faster.
Personally I like Ulrich's suggestion, as it requires no change to
userspace. I had even considered it in developing the patch, but with
the current vsyscall-sysenter being all asm, I figured I could implement
the LD_PRELOAD code much faster. 

Another issue with having a separate entry point for vgettimeofday is
that I don't quite understand how glibc detects if vsyscall is
available, and how deals with the vsyscall page moving around. It seems
the i386 4/4g split patch moved the vsyscall-sysenter page to 0xffffd000
(instead of 0xffffe000). I've conditionally padded the fixmap table so
vgettimeofday() is at 0xffffc000 regardless, but clearly this isn't the
best thing to do. 

Thoughts?

thanks
-john


  reply	other threads:[~2004-01-30  0:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29  2:46 john stultz
2004-01-29  5:06 ` Ulrich Drepper
2004-01-29 13:26   ` Jamie Lokier
2004-01-29 18:05     ` Ulrich Drepper
2004-01-29 19:15       ` Jamie Lokier
2004-01-29 23:59         ` john stultz [this message]
2004-01-30  0:40           ` Ulrich Drepper
2004-01-30  0:31         ` Ulrich Drepper
2004-01-30  4:17           ` Jamie Lokier
2004-01-30  5:09             ` Ulrich Drepper
2004-01-30  9:29               ` Ingo Molnar
2004-02-03  4:38                 ` Ulrich Drepper
2004-01-30 17:34               ` Jamie Lokier
2004-01-30  8:33             ` Jakub Jelinek
2004-01-30 17:21               ` Jamie Lokier
2004-01-31  0:10     ` Eric W. Biederman
2004-01-31  2:41       ` Jamie Lokier
2004-01-31  5:54         ` Eric W. Biederman
2004-02-01  1:28   ` Andrea Arcangeli
2004-02-03  4:35     ` Ulrich Drepper
2004-02-03  5:34       ` Andrea Arcangeli
2004-02-03  8:52       ` Jamie Lokier
2004-02-03 16:25         ` Andrea Arcangeli
2004-02-03 17:37           ` Jamie Lokier
2004-02-03 18:10             ` Andrea Arcangeli
2004-02-03 18:23               ` Jamie Lokier
2004-02-03 18:34                 ` Andrea Arcangeli
2004-01-31  0:17 ` Eric W. Biederman
2004-01-31  2:20   ` john stultz
     [not found] <1075344395.1592.87.camel@cog.beaverton.ibm.com.suse.lists.linux.kernel>
     [not found] ` <401894DA.7000609@redhat.com.suse.lists.linux.kernel>
     [not found]   ` <20040201012803.GN26076@dualathlon.random.suse.lists.linux.kernel>
     [not found]     ` <401F251C.2090300@redhat.com.suse.lists.linux.kernel>
     [not found]       ` <20040203085224.GA15738@mail.shareable.org.suse.lists.linux.kernel>
     [not found]         ` <20040203162515.GY26076@dualathlon.random.suse.lists.linux.kernel>
     [not found]           ` <20040203173716.GC17895@mail.shareable.org.suse.lists.linux.kernel>
     [not found]             ` <20040203181001.GA26076@dualathlon.random.suse.lists.linux.kernel>
     [not found]               ` <20040203182310.GA18326@mail.shareable.org.suse.lists.linux.kernel>
2004-02-04  2:27                 ` Andi Kleen
2004-02-04  2:40                   ` Andrea Arcangeli
2004-02-04  4:21                   ` Jamie Lokier
2004-02-05 21:43                     ` Andrea Arcangeli
2004-02-06  4:15                       ` Rik van Riel
2004-02-06  4:28                         ` Andrea Arcangeli
2004-02-06  9:23                           ` Ulrich Drepper
2004-02-06 15:49                             ` Andrea Arcangeli
2004-02-07  0:37                               ` Ulrich Drepper
2004-02-07  2:19                                 ` Andrea Arcangeli
2004-02-07  3:37                                   ` Daniel Jacobowitz
2004-02-07  4:36                                     ` Andrea Arcangeli
2004-02-07  4:53                                       ` Jamie Lokier

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=1075420794.1592.162.camel@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=drepper@redhat.com \
    --cc=jamie@shareable.org \
    --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®