Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1745943pxb; Mon, 12 Apr 2021 05:56:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4zomo5T8qkXWibfysuob7tuFcVQoJaptWqQSB4ISJnmM/DEY8381KnR0AAd/45jtiI8O5 X-Received: by 2002:aa7:db9a:: with SMTP id u26mr28881184edt.292.1618232186162; Mon, 12 Apr 2021 05:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618232186; cv=none; d=google.com; s=arc-20160816; b=mvBs4+aHB42wCNaTAHSPwp01TQEjK5hB5FnM8ZIpaGupKQynLlNDTpih4vaCTxOIZ6 LrdreJqOlgeEB9O/aojwYKfq/7b8/NNFuGyISMfk+A3pIXALfiq93D1aGRdIzAMzQR09 lOYPsOB4/TYQsIJWALEvTyuZycsB2giCGuV+S7PA6TJINUAK5kmEuTVdVEXYszS2wnJQ YgOONmanNVteOmhNJKWsLrXwgDXg079bSfS36vmkO8vBOthEPbp0POg+FA1HGOBu0E5C UZeiD7lHfHJ8yZllBDBj188urY+FrKyJnMQWcrOiysmESdsoP6IcU53/v2a3siZtjQDX +Lyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=zx9Nswo8vrpVq052zCcHGH+d0shFYuCL7ozYDULcNkw=; b=YSb7xnW/brwinfOqfG3HHrrFMep5qN8M+evGZYwagMQ+El+HQdKlvsxfdmA9t8CYet fdGam00f1AMKVf02K0smSoOX/D0hfhEp127w6UyjkOpjt1s2Lxdx03z9NMmbZ9VvKTCj 9XBwqGTWIWiW5O009vAYHhdJLdbsC0i2YzItRCrVbsPpQpL/Fn07XW/YfA4poux7u95c vxD1/43a6MgyBgKw/CoPMSBUemDmEP6q1l3nfVENo7dD8I9sPfCILgghj2cfiYaOaSq3 f2QOA3DhlzzmNa6h5HGBAsmp+PPjavxvlCZTnQT+K93gSPiLWNWaby3ryaoN66Ad1N+E Yb6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si7518628ejk.205.2021.04.12.05.56.00; Mon, 12 Apr 2021 05:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241236AbhDLMzW (ORCPT + 99 others); Mon, 12 Apr 2021 08:55:22 -0400 Received: from foss.arm.com ([217.140.110.172]:49950 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240333AbhDLMzV (ORCPT ); Mon, 12 Apr 2021 08:55:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82EA51FB; Mon, 12 Apr 2021 05:55:03 -0700 (PDT) Received: from [10.37.12.6] (unknown [10.37.12.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E9C53F73B; Mon, 12 Apr 2021 05:55:00 -0700 (PDT) Subject: Re: [PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline() To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dima@arista.com, avagin@gmail.com, arnd@arndb.de, tglx@linutronix.de, luto@kernel.org, linux-arch@vger.kernel.org References: <90dcf45ebadfd5a07f24241551c62f619d1cb930.1617209142.git.christophe.leroy@csgroup.eu> From: Vincenzo Frascino Message-ID: <8b42e769-2f17-e2b4-4d2a-b86c4e412598@arm.com> Date: Mon, 12 Apr 2021 13:54:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <90dcf45ebadfd5a07f24241551c62f619d1cb930.1617209142.git.christophe.leroy@csgroup.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Vincenzo Frascino > --- > 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