lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch V2 03/17] lib/vdso: Allow the high resolution parts to be compiled out
From
Date
On 2/7/20 12:38 PM, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> If the architecture knows at compile time that there is no VDSO capable
> clocksource supported it makes sense to optimize the guts of the high
> resolution parts of the VDSO out at build time. Add a helper function to
> check whether the VDSO should be high resolution capable and provide a stub
> which can be overridden by an architecture.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
> lib/vdso/gettimeofday.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -38,6 +38,13 @@ u64 vdso_calc_delta(u64 cycles, u64 last
> }
> #endif
>
> +#ifndef __arch_vdso_hres_capable
> +static inline bool __arch_vdso_hres_capable(void)
> +{
> + return true;
> +}
> +#endif
> +
> #ifdef CONFIG_TIME_NS
> static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
> struct __kernel_timespec *ts)
> @@ -101,6 +108,10 @@ static __always_inline int do_hres(const
> u64 cycles, last, sec, ns;
> u32 seq;
>
> + /* Allows to compile the high resolution parts out */
> + if (!__arch_vdso_hres_capable())
> + return -1;
> +
> do {
> /*
> * Open coded to handle VCLOCK_TIMENS. Time namespace
>

--
Regards,
Vincenzo

\
 
 \ /
  Last update: 2020-02-14 12:55    [W:0.210 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site