From: John Stultz <john.stultz@linaro.org>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
Tony Luck <tony.luck@intel.com>,
Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Paul Turner <pjt@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Prarit Bhargava <prarit@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core
Date: Tue, 18 Sep 2012 11:29:50 -0700 [thread overview]
Message-ID: <5058BD9E.30909@linaro.org> (raw)
In-Reply-To: <20120918180200.GA2281@netboy.at.omicron.at>
On 09/18/2012 11:02 AM, Richard Cochran wrote:
> On Mon, Sep 17, 2012 at 05:20:41PM -0700, John Stultz wrote:
>> On 09/17/2012 04:49 PM, Andy Lutomirski wrote:
>>> 2. There's nothing vsyscall-specific about the code in
>>> vclock_gettime.c. In fact, the VVAR macro should work just fine in
>>> kernel code. If you moved all this code into a header, then in-kernel
>>> uses could use it, and maybe even other arches could use it. Last
>>> time I checked, it seemed like vclock_gettime was considerably faster
>>> than whatever the in-kernel equivalent did.
>> I like the idea of unifying the implementations, but I'd want to
>> know more about why vclock_gettime was faster then the in-kernel
>> getnstimeofday(), since it might be due to the more limited locking
>> (we only update vsyscall data under the vsyscall lock, where as the
>> timekeeper lock is held for the entire execution of
>> update_wall_time()), or some of the optimizations in the vsyscall
>> code is focused on providing timespecs to userland, where as
>> in-kernel we also have to provide ktime_ts.
> This there a valid technical reason why each arch has its own vdso
> implementation?
I believe its mostly historical, but on some architectures that history
has become an established ABI, making it technical.
powerpc, for example exports timekeeping data at a specific address, and
the code logic to use that data is in userland libraries, outside of
kernel control. ia64 uses a fsyscall method, which is (to my
understanding) a mode that allows limited access to kernel data from
userland, but restricts what instructions can be used, requiring it to
be hand written in asm.
Now, x86_64 too had its own magic vsyscall address that was hard coded,
but Andy did some very cool work allowing that to bounce to the normal
syscall for compatability, allowing the nicer vdso method to be used.
It may be that such a vdso method could be introduced and migrated to on
these other arches, but we'd still have to preserve the existing ABI as
well (and in cases like ppc, that preservation would be just as
complicated as it is now).
> If not, I would suggest that the first step would be to refactor these
> into one C-language header. If this can be shared with kernel code,
> then all the better.
>
> It would make it a lot easier to fix the leap second thing, too.
Indeed, it would be nice. Tweaking the ia64 fsyscall isn't anything I
look forward to. :)
But such heavy lifting will likely need to be done by arch maintainers.
That's why with this patchset I preserve the existing method, but make
it clear its deprecated and allow arches that don't need the old method
to avoid the extra overhead caused by the additional rounding fix. Then
those arches can migrate when they can, rather then having to block
change on everyone conforming to a new standard.
thanks
-john
next prev parent reply other threads:[~2012-09-18 18:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 22:04 [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core John Stultz
2012-09-17 22:04 ` [PATCH 1/6][RFC] time: Move timekeeper structure to timekeeper_internal.h for vsyscall changes John Stultz
2012-09-17 22:04 ` [PATCH 2/6][RFC] time: Move update_vsyscall definitions to timekeeper_internal.h John Stultz
2012-09-27 3:14 ` Paul Mackerras
2012-09-17 22:04 ` [PATCH 3/6][RFC] time: Convert CONFIG_GENERIC_TIME_VSYSCALL to CONFIG_GENERIC_TIME_VSYSCALL_OLD John Stultz
2012-09-27 3:14 ` Paul Mackerras
2012-09-17 22:04 ` [PATCH 4/6][RFC] time: Introduce new GENERIC_TIME_VSYSCALL John Stultz
2012-09-17 22:05 ` [PATCH 5/6][RFC] time: Only do nanosecond rounding on GENERIC_TIME_VSYSCALL_OLD systems John Stultz
2012-09-17 22:05 ` [PATCH 6/6][RFC] time: Convert x86_64 to using new update_vsyscall John Stultz
2012-09-17 23:49 ` [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core Andy Lutomirski
2012-09-18 0:20 ` John Stultz
2012-09-18 0:43 ` Andy Lutomirski
2012-09-18 18:02 ` Richard Cochran
2012-09-18 18:17 ` Andy Lutomirski
2012-09-18 18:29 ` John Stultz [this message]
2012-09-19 4:50 ` Richard Cochran
2012-09-19 5:30 ` Andy Lutomirski
2012-09-19 16:31 ` John Stultz
2012-09-19 17:03 ` Richard Cochran
2012-09-19 17:54 ` John Stultz
2012-09-19 18:26 ` Andy Lutomirski
2012-09-19 20:50 ` Luck, Tony
2012-09-19 21:11 ` John Stultz
2012-09-20 7:36 ` Richard Cochran
2012-09-19 21:15 ` Andy Lutomirski
2012-09-20 14:31 ` Steven Rostedt
2012-09-20 17:32 ` Andy Lutomirski
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=5058BD9E.30909@linaro.org \
--to=john.stultz@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=paulus@samba.org \
--cc=pjt@google.com \
--cc=prarit@redhat.com \
--cc=richardcochran@gmail.com \
--cc=rostedt@goodmis.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.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