This is the mail archive of the
mailing list for the glibc project.
Re: [Patch] Use VDSO interface for gettimeofday on aarch64
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: Steve Ellcey <sellcey at cavium dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 10 May 2018 17:28:38 -0700
- Subject: Re: [Patch] Use VDSO interface for gettimeofday on aarch64
- References: <firstname.lastname@example.org>
Steve Ellcey wrote:
> This is a Aarch64 version of gettimeofday that uses the VDSO interface
> when it is available. I did a test with 100000000 gettimeofday calls
> on a T88 and the time went from 7.1 seconds to 5.5 seconds. I also
> ran the glibc testsuite and I did not get any regressions.
> --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
> @@ -0,0 +1,69 @@
> +/* PREPARE_VERSION will need an __LP64__ ifdef when ILP32 support
> + goes in. See _libc_vdso_platform_setup in
> + sysdeps/unix/sysv/linux/aarch64/init-first.c. */
> +# undef INIT_ARCH
> +# define INIT_ARCH() \
> + PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); \
Can this be added as a PREPARE_VERSION_KNOWN?
> + void *vdso_gettimeofday = \
> + _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version);
I was surprised to see LINUX_2.6.39 here, but that's really what the
symbol version exported from Linux is called. It was actually
introduced in v3.7-rc1~178^2~15. I then suspected it was for
consistency with arm, but arm uses LINUX_2.6. Maybe that's just how
long it took for the patch to be merged?
Not related to your patch, just an issue I was curious about on the
The rest looks good.
With or without the PREPARE_VERSION_KNOWN change mentioned above,
Reviewed-by: Jonathan Nieder <email@example.com>