lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Apr 2021 13:54:58 +0100
From:   Vincenzo Frascino <vincenzo.frascino@....com>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>
Cc:     linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        dima@...sta.com, avagin@...il.com, arnd@...db.de,
        tglx@...utronix.de, luto@...nel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and
 do_coarse_timens() __always_inline()



On 3/31/21 5:48 PM, Christophe Leroy wrote:
> In the same spirit as commit c966533f8c6c ("lib/vdso: Mark do_hres()
> and do_coarse() as __always_inline"), mark do_hres_timens() and
> do_coarse_timens() __always_inline.
> 
> The measurement below in on a non timens process, ie on the fastest path.
> 
> On powerpc32, without the patch:
> 
> clock-gettime-monotonic-raw:    vdso: 1155 nsec/call
> clock-gettime-monotonic-coarse:    vdso: 813 nsec/call
> clock-gettime-monotonic:    vdso: 1076 nsec/call
> 
> With the patch:
> 
> clock-gettime-monotonic-raw:    vdso: 1100 nsec/call
> clock-gettime-monotonic-coarse:    vdso: 667 nsec/call
> clock-gettime-monotonic:    vdso: 1025 nsec/call
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>

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

> ---
>  lib/vdso/gettimeofday.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 2919f1698140..c6f6dee08746 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -46,8 +46,8 @@ static inline bool vdso_cycles_ok(u64 cycles)
>  #endif
>  
>  #ifdef CONFIG_TIME_NS
> -static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
> -			  struct __kernel_timespec *ts)
> +static __always_inline int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
> +					  struct __kernel_timespec *ts)
>  {
>  	const struct vdso_data *vd = __arch_get_timens_vdso_data();
>  	const struct timens_offset *offs = &vdns->offset[clk];
> @@ -97,8 +97,8 @@ static __always_inline const struct vdso_data *__arch_get_timens_vdso_data(void)
>  	return NULL;
>  }
>  
> -static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
> -			  struct __kernel_timespec *ts)
> +static __always_inline int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
> +					  struct __kernel_timespec *ts)
>  {
>  	return -EINVAL;
>  }
> @@ -159,8 +159,8 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
>  }
>  
>  #ifdef CONFIG_TIME_NS
> -static int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
> -			    struct __kernel_timespec *ts)
> +static __always_inline int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
> +					    struct __kernel_timespec *ts)
>  {
>  	const struct vdso_data *vd = __arch_get_timens_vdso_data();
>  	const struct vdso_timestamp *vdso_ts = &vd->basetime[clk];
> @@ -188,8 +188,8 @@ static int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
>  	return 0;
>  }
>  #else
> -static int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
> -			    struct __kernel_timespec *ts)
> +static __always_inline int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
> +					    struct __kernel_timespec *ts)
>  {
>  	return -1;
>  }
> 

-- 
Regards,
Vincenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ