Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Andy Lutomirski
On Thu, Sep 20, 2012 at 7:31 AM, Steven Rostedt wrote: > On Mon, 2012-09-17 at 16:49 -0700, Andy Lutomirski wrote: > >> I haven't looked in any great detail, but the approach looks sensible >> and should slow down the vsyscall code. >> >> That being said, as long as you're playing with this, here

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Steven Rostedt
On Mon, 2012-09-17 at 16:49 -0700, Andy Lutomirski wrote: > I haven't looked in any great detail, but the approach looks sensible > and should slow down the vsyscall code. > > That being said, as long as you're playing with this, here are a > couple thoughts: > > 1. The TSC-reading code does

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Richard Cochran
On Wed, Sep 19, 2012 at 02:11:02PM -0700, John Stultz wrote: > Now, I suspect the difficult part will be finding someone with the > time and interest to try get the vdso gettime working on ia64 (or > s390 or powerpc), and then try to unify the kernel side > implementation. Reducing the maintenance

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Richard Cochran
On Wed, Sep 19, 2012 at 02:11:02PM -0700, John Stultz wrote: Now, I suspect the difficult part will be finding someone with the time and interest to try get the vdso gettime working on ia64 (or s390 or powerpc), and then try to unify the kernel side implementation. Reducing the maintenance

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Steven Rostedt
On Mon, 2012-09-17 at 16:49 -0700, Andy Lutomirski wrote: I haven't looked in any great detail, but the approach looks sensible and should slow down the vsyscall code. That being said, as long as you're playing with this, here are a couple thoughts: 1. The TSC-reading code does this:

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-20 Thread Andy Lutomirski
On Thu, Sep 20, 2012 at 7:31 AM, Steven Rostedt rost...@goodmis.org wrote: On Mon, 2012-09-17 at 16:49 -0700, Andy Lutomirski wrote: I haven't looked in any great detail, but the approach looks sensible and should slow down the vsyscall code. That being said, as long as you're playing with

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Andy Lutomirski
On Wed, Sep 19, 2012 at 1:50 PM, Luck, Tony wrote: >> Does anything except the vDSO actually use the vDSO data page? It's >> mapped as part of the vDSO image (i.e. at a non-constant address), and >> it's not immediate obvious how userspace would locate that page. > > Just for reference - on ia64

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/19/2012 01:50 PM, Luck, Tony wrote: Does anything except the vDSO actually use the vDSO data page? It's mapped as part of the vDSO image (i.e. at a non-constant address), and it's not immediate obvious how userspace would locate that page. Just for reference - on ia64 the address of the

RE: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Luck, Tony
> Does anything except the vDSO actually use the vDSO data page? It's > mapped as part of the vDSO image (i.e. at a non-constant address), and > it's not immediate obvious how userspace would locate that page. Just for reference - on ia64 the address of the entry point for the magic fast system

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Andy Lutomirski
On Wed, Sep 19, 2012 at 10:54 AM, John Stultz wrote: > On 09/19/2012 10:03 AM, Richard Cochran wrote: >> >> On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: >>> >>> With powerpc, there is no arch specific kernel code involved, its >>> just a data structure the kernel exports that is

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/19/2012 10:03 AM, Richard Cochran wrote: On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: With powerpc, there is no arch specific kernel code involved, its just a data structure the kernel exports that is accessible to userland. The execution logic lives in userland libraries,

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Richard Cochran
On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: > On powerpc, I mean magic addresses where userland can find > structures that it can use to calculate time. ... > With powerpc, there is no arch specific kernel code involved, its > just a data structure the kernel exports that is

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/18/2012 09:50 PM, Richard Cochran wrote: On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: I believe its mostly historical, but on some architectures that history has become an established ABI, making it technical. Fine, but what do you mean by "ABI?" Are you talking about

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/18/2012 09:50 PM, Richard Cochran wrote: On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: I believe its mostly historical, but on some architectures that history has become an established ABI, making it technical. Fine, but what do you mean by ABI? Are you talking about magic

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Richard Cochran
On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: On powerpc, I mean magic addresses where userland can find structures that it can use to calculate time. ... With powerpc, there is no arch specific kernel code involved, its just a data structure the kernel exports that is

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/19/2012 10:03 AM, Richard Cochran wrote: On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: With powerpc, there is no arch specific kernel code involved, its just a data structure the kernel exports that is accessible to userland. The execution logic lives in userland libraries,

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Andy Lutomirski
On Wed, Sep 19, 2012 at 10:54 AM, John Stultz john.stu...@linaro.org wrote: On 09/19/2012 10:03 AM, Richard Cochran wrote: On Wed, Sep 19, 2012 at 09:31:35AM -0700, John Stultz wrote: With powerpc, there is no arch specific kernel code involved, its just a data structure the kernel exports

RE: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Luck, Tony
Does anything except the vDSO actually use the vDSO data page? It's mapped as part of the vDSO image (i.e. at a non-constant address), and it's not immediate obvious how userspace would locate that page. Just for reference - on ia64 the address of the entry point for the magic fast system

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread John Stultz
On 09/19/2012 01:50 PM, Luck, Tony wrote: Does anything except the vDSO actually use the vDSO data page? It's mapped as part of the vDSO image (i.e. at a non-constant address), and it's not immediate obvious how userspace would locate that page. Just for reference - on ia64 the address of the

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-19 Thread Andy Lutomirski
On Wed, Sep 19, 2012 at 1:50 PM, Luck, Tony tony.l...@intel.com wrote: Does anything except the vDSO actually use the vDSO data page? It's mapped as part of the vDSO image (i.e. at a non-constant address), and it's not immediate obvious how userspace would locate that page. Just for

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Andy Lutomirski
On Tue, Sep 18, 2012 at 9:50 PM, Richard Cochran wrote: > On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: >> I believe its mostly historical, but on some architectures that >> history has become an established ABI, making it technical. > > Fine, but what do you mean by "ABI?" Are you

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Richard Cochran
On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: > I believe its mostly historical, but on some architectures that > history has become an established ABI, making it technical. Fine, but what do you mean by "ABI?" Are you talking about magic addresses for functions? Without knowing

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread John Stultz
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

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Andy Lutomirski
On Tue, Sep 18, 2012 at 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

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Richard Cochran
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,

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Richard Cochran
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

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Andy Lutomirski
On Tue, Sep 18, 2012 at 11:02 AM, Richard Cochran richardcoch...@gmail.com 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

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread John Stultz
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

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Richard Cochran
On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: I believe its mostly historical, but on some architectures that history has become an established ABI, making it technical. Fine, but what do you mean by ABI? Are you talking about magic addresses for functions? Without knowing the

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-18 Thread Andy Lutomirski
On Tue, Sep 18, 2012 at 9:50 PM, Richard Cochran richardcoch...@gmail.com wrote: On Tue, Sep 18, 2012 at 11:29:50AM -0700, John Stultz wrote: I believe its mostly historical, but on some architectures that history has become an established ABI, making it technical. Fine, but what do you mean

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread John Stultz
On 09/17/2012 04:49 PM, Andy Lutomirski wrote: On Mon, Sep 17, 2012 at 3:04 PM, John Stultz wrote: This item has been on my todo list for a number of years. One interesting bit of the timekeeping code is that we internally keep sub-nanosecond precision. This allows for really fine grained

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread Andy Lutomirski
On Mon, Sep 17, 2012 at 5:20 PM, John Stultz wrote: > On 09/17/2012 04:49 PM, Andy Lutomirski wrote: >> >> On Mon, Sep 17, 2012 at 3:04 PM, John Stultz >> wrote: >>> >>> Anyway, I'd greatly appreciate any thoughts or feedback on this >>> approach. >> >> I haven't looked in any great detail, but

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread Andy Lutomirski
On Mon, Sep 17, 2012 at 3:04 PM, John Stultz wrote: > This item has been on my todo list for a number of years. > > One interesting bit of the timekeeping code is that we internally > keep sub-nanosecond precision. This allows for really fine > grained error accounting, which allows us to keep

[PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread John Stultz
This item has been on my todo list for a number of years. One interesting bit of the timekeeping code is that we internally keep sub-nanosecond precision. This allows for really fine grained error accounting, which allows us to keep long term accuracy, even if the clocksource can only make very

[PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread John Stultz
This item has been on my todo list for a number of years. One interesting bit of the timekeeping code is that we internally keep sub-nanosecond precision. This allows for really fine grained error accounting, which allows us to keep long term accuracy, even if the clocksource can only make very

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread Andy Lutomirski
On Mon, Sep 17, 2012 at 3:04 PM, John Stultz john.stu...@linaro.org wrote: This item has been on my todo list for a number of years. One interesting bit of the timekeeping code is that we internally keep sub-nanosecond precision. This allows for really fine grained error accounting, which

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread Andy Lutomirski
On Mon, Sep 17, 2012 at 5:20 PM, John Stultz john.stu...@linaro.org wrote: On 09/17/2012 04:49 PM, Andy Lutomirski wrote: On Mon, Sep 17, 2012 at 3:04 PM, John Stultz john.stu...@linaro.org wrote: Anyway, I'd greatly appreciate any thoughts or feedback on this approach. I haven't looked

Re: [PATCH 0/6][RFC] Rework vsyscall to avoid truncation/rounding issue in timekeeping core

2012-09-17 Thread John Stultz
On 09/17/2012 04:49 PM, Andy Lutomirski wrote: On Mon, Sep 17, 2012 at 3:04 PM, John Stultz john.stu...@linaro.org wrote: This item has been on my todo list for a number of years. One interesting bit of the timekeeping code is that we internally keep sub-nanosecond precision. This allows for