mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Russell King <linux@armlinux.org.uk>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: VDSO: remove cntvct_ok global variable
Date: Fri, 3 Nov 2023 08:35:00 +0000	[thread overview]
Message-ID: <9ef78d40-fcdd-4ff8-b5ee-58b7478534a9@arm.com> (raw)
In-Reply-To: <20231103075800.3254680-1-linux@rasmusvillemoes.dk>

On 11/3/23 07:57, Rasmus Villemoes wrote:
> The cntvct_ok variable has not had any external user since commit
> c7a18100bdff ("lib/vdso: Avoid highres update if clocksource is not
> VDSO capable").
> 
> It also only has one user in vdso.c, once during init, so rather than
> having the caller of patch_vdso() initialize cntvct_ok, just call
> cntvct_functional() directly and avoid the global variable entirely.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Fine by me.

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

> ---
>  arch/arm/include/asm/vdso/vsyscall.h |  1 -
>  arch/arm/kernel/vdso.c               | 10 +++-------
>  2 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/include/asm/vdso/vsyscall.h b/arch/arm/include/asm/vdso/vsyscall.h
> index 47e41ae8ccd0..9a2cd2673a82 100644
> --- a/arch/arm/include/asm/vdso/vsyscall.h
> +++ b/arch/arm/include/asm/vdso/vsyscall.h
> @@ -9,7 +9,6 @@
>  #include <asm/cacheflush.h>
>  
>  extern struct vdso_data *vdso_data;
> -extern bool cntvct_ok;
>  
>  /*
>   * Update the vDSO data page to keep in sync with kernel timekeeping.
> diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
> index f297d66a8a76..ba87ffc6f194 100644
> --- a/arch/arm/kernel/vdso.c
> +++ b/arch/arm/kernel/vdso.c
> @@ -67,11 +67,9 @@ struct elfinfo {
>  	char		*dynstr;	/* ptr to .dynstr section */
>  };
>  
> -/* Cached result of boot-time check for whether the arch timer exists,
> - * and if so, whether the virtual counter is useable.
> +/* Boot-time check for whether the arch timer exists, and if so,
> + * whether the virtual counter is useable.
>   */
> -bool cntvct_ok __ro_after_init;
> -
>  static bool __init cntvct_functional(void)
>  {
>  	struct device_node *np;
> @@ -172,7 +170,7 @@ static void __init patch_vdso(void *ehdr)
>  	 * want programs to incur the slight additional overhead of
>  	 * dispatching through the VDSO only to fall back to syscalls.
>  	 */
> -	if (!cntvct_ok) {
> +	if (!cntvct_functional()) {
>  		vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
>  		vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
>  		vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
> @@ -213,8 +211,6 @@ static int __init vdso_init(void)
>  	vdso_total_pages = 1; /* for the data/vvar page */
>  	vdso_total_pages += text_pages;
>  
> -	cntvct_ok = cntvct_functional();
> -
>  	patch_vdso(vdso_start);
>  
>  	return 0;

-- 
Regards,
Vincenzo

      reply	other threads:[~2023-11-03  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03  7:57 Rasmus Villemoes
2023-11-03  8:35 ` Vincenzo Frascino [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ef78d40-fcdd-4ff8-b5ee-58b7478534a9@arm.com \
    --to=vincenzo.frascino@arm.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®