mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] mips: add vdso support
@ 2016-01-23 20:31 Hauke Mehrtens
  2016-01-23 23:29 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2016-01-23 20:31 UTC (permalink / raw)
  To: musl; +Cc: Hauke Mehrtens

vdso support is available on mips starting with kernel 4.4, see kernel
commit a7f4df4e21 "MIPS: VDSO: Add implementations of gettimeofday()
and clock_gettime()" for details.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 arch/mips/syscall_arch.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h
index e74e0ad..39c0ea3 100644
--- a/arch/mips/syscall_arch.h
+++ b/arch/mips/syscall_arch.h
@@ -161,3 +161,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
 	if (n == SYS_fstatat) __stat_fix(c);
 	return r2;
 }
+
+#define VDSO_USEFUL
+#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT_VER "LINUX_2.6"
-- 
2.7.0.rc3



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: add vdso support
  2016-01-23 20:31 [PATCH] mips: add vdso support Hauke Mehrtens
@ 2016-01-23 23:29 ` Rich Felker
  2016-01-23 23:39   ` Hauke Mehrtens
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2016-01-23 23:29 UTC (permalink / raw)
  To: musl

On Sat, Jan 23, 2016 at 09:31:58PM +0100, Hauke Mehrtens wrote:
> vdso support is available on mips starting with kernel 4.4, see kernel
> commit a7f4df4e21 "MIPS: VDSO: Add implementations of gettimeofday()
> and clock_gettime()" for details.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  arch/mips/syscall_arch.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h
> index e74e0ad..39c0ea3 100644
> --- a/arch/mips/syscall_arch.h
> +++ b/arch/mips/syscall_arch.h
> @@ -161,3 +161,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
>  	if (n == SYS_fstatat) __stat_fix(c);
>  	return r2;
>  }
> +
> +#define VDSO_USEFUL
> +#define VDSO_CGT_SYM "__vdso_clock_gettime"
> +#define VDSO_CGT_VER "LINUX_2.6"
> -- 
> 2.7.0.rc3

Nice! Have you tested it on some real hardware with vdso support to
confirm that it's working properly?

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mips: add vdso support
  2016-01-23 23:29 ` Rich Felker
@ 2016-01-23 23:39   ` Hauke Mehrtens
  0 siblings, 0 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2016-01-23 23:39 UTC (permalink / raw)
  To: musl

On 01/24/2016 12:29 AM, Rich Felker wrote:
> On Sat, Jan 23, 2016 at 09:31:58PM +0100, Hauke Mehrtens wrote:
>> vdso support is available on mips starting with kernel 4.4, see kernel
>> commit a7f4df4e21 "MIPS: VDSO: Add implementations of gettimeofday()
>> and clock_gettime()" for details.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  arch/mips/syscall_arch.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h
>> index e74e0ad..39c0ea3 100644
>> --- a/arch/mips/syscall_arch.h
>> +++ b/arch/mips/syscall_arch.h
>> @@ -161,3 +161,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
>>  	if (n == SYS_fstatat) __stat_fix(c);
>>  	return r2;
>>  }
>> +
>> +#define VDSO_USEFUL
>> +#define VDSO_CGT_SYM "__vdso_clock_gettime"
>> +#define VDSO_CGT_VER "LINUX_2.6"
>> -- 
>> 2.7.0.rc3
> 
> Nice! Have you tested it on some real hardware with vdso support to
> confirm that it's working properly?
> 
> Rich
> 
Hi Rich,

yes I tested this on Lantiq VRX200 (MIPS 34Kc V5.6) hardware.

I called clock_gettime(CLOCK_MONOTONIC, &tp) 1.000.000 times and it was
about 60% faster with this patch.

without vdso:
root@OpenWrt:/# time ./vdso-test
real    0m 0.95s
user    0m 0.24s
sys     0m 0.70s

with vdso:
root@OpenWrt:/# time /usr/bin/vdso-test
real    0m 0.35s
user    0m 0.34s
sys     0m 0.00s

Hauke


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-23 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-23 20:31 [PATCH] mips: add vdso support Hauke Mehrtens
2016-01-23 23:29 ` Rich Felker
2016-01-23 23:39   ` Hauke Mehrtens

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).