[PATCH] Make ppc64-linux use VDSO gettimeofday instead of time syscall

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Make ppc64-linux use VDSO gettimeofday instead of time syscall

Carlos Eduardo Seo

Hello

Currently, in ppc64-linux we use linux/time.c, which uses the time syscall. unix/time.c, on the other hand, will use gettimeofday(), which uses the VDSO.

This small patch makes ppc64 use unix/time.c, which is faster than the current method. It's the same approach used by sysdeps/unix/sysv/linux/sparc/sparc64.

Regards,

--
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center


ppc-time-perf.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make ppc64-linux use VDSO gettimeofday instead of time syscall

Ulrich Drepper
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/22/2010 07:21 AM, Carlos Eduardo Seo wrote:
> This small patch makes ppc64 use unix/time.c, which is faster than
> the current method. It's the same approach used by
> sysdeps/unix/sysv/linux/sparc/sparc64.

That might be the case but is it really correct?  The time() results
don't necessarily correspond to the full seconds returned by gtod.
There were lots of problems in this area and maybe there still are.
This is why the x86-64 port has a separate time vsyscall.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkuqZkEACgkQ2ijCOnn/RHRQnACfXGNlagSRQ28Vvyb2bVLUECJY
gWoAn1loVd6vDON+zgD5dg746SWfex2/
=jM0i
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make ppc64-linux use VDSO gettimeofday instead of time syscall

Steve Munroe

[hidden email] wrote on 03/24/2010 02:21:37 PM:

>
> Re: [PATCH] Make ppc64-linux use VDSO gettimeofday instead of time
syscall

>
> Ulrich Drepper
>
> to:
>
> libc-alpha 03/24/2010 02:22 PM
> ...
>
> On 03/22/2010 07:21 AM, Carlos Eduardo Seo wrote:
> > This small patch makes ppc64 use unix/time.c, which is faster than
> > the current method. It's the same approach used by
> > sysdeps/unix/sysv/linux/sparc/sparc64.
>
> That might be the case but is it really correct?  The time() results
> don't necessarily correspond to the full seconds returned by gtod.
> There were lots of problems in this area and maybe there still are.
> This is why the x86-64 port has a separate time vsyscall.
>
What is your specific concern with correctness and this approach?
What are the specific problems you would like us to address?

As far as we can tell x86_64 vtime is using vsyscall gtod and copying
tv_sec under the covers.

Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make ppc64-linux use VDSO gettimeofday instead of time syscall

Ulrich Drepper
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/25/2010 08:15 AM, Steve Munroe wrote:
> What is your specific concern with correctness and this approach?

If the time users, one using the syscall and one using gtod see
non-monotonic times this is a disaster.  They can be in different
processes.  Or in the kernel (file timestamps).  This has happened and I
am not sure this patch doesn't create such a situation.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkusomsACgkQ2ijCOnn/RHTUOQCguV2pVIRzD8c+9LP0jeZlYq3j
wLoAoK/0oDHVBe1NJ8LMjSZZhpp7bVh4
=kSPH
-----END PGP SIGNATURE-----