From: Andi Kleen <andi@firstfloor.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: Duplication of vdso and vsyscall code?
Date: Sat, 10 Oct 2009 06:14:42 +0200 [thread overview]
Message-ID: <20091010041442.GF1656@one.firstfloor.org> (raw)
In-Reply-To: <4ACFA80E.7050701@goop.org>
On Fri, Oct 09, 2009 at 02:15:58PM -0700, Jeremy Fitzhardinge wrote:
> arch/x86/kernel/vsyscall_64.c implements vgettimeofday and vgetcpu.
> (And vtime)
>
> arch/x86/vdso/vclock_gettime.c implements __vdso_gettimeofday (and
> __vdso_clock_gettime), and vgetcpu.c has __vdso_getcpu.
>
> These appear to be functionally identical duplicate definitions. I
> don't understand the history here to know how we came to get two sets of
> these functions, but surely we can share the same code for both of these?
One is at a fixed position in the user address space, and the other at a
randomized position. The fixed one came first. Fixed doesn't know
where randomized is. Randomized is also compiled and linked completely
differently. In theory the randomized one could call the fixed one, but
originally there were some thoughts about turning off fixed for some
applications that don't need it and also the path was considered very
performance critical, so unneeded jumps were avoided.
In theory you could probably #include the code from a common file, but it
wouldn't buy you too much. I think there were originally some
differences in the vgettimeofday() implementations too, although
that might have changed with all the timer reorganizations.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2009-10-10 4:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 21:15 Duplication of vdso and vsyscall code? Jeremy Fitzhardinge
2009-10-10 4:14 ` Andi Kleen [this message]
2009-10-10 4:47 ` Jeremy Fitzhardinge
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=20091010041442.GF1656@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=x86@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