[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANDhNCqLST-im8WJXTWPsXmqhq2JM9+nVB6phixxH2PT-tQ3Tg@mail.gmail.com>
Date: Thu, 26 Jun 2025 21:43:40 -0700
From: John Stultz <jstultz@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org,
Richard Cochran <richardcochran@...il.com>, Christopher Hall <christopher.s.hall@...el.com>,
Frederic Weisbecker <frederic@...nel.org>, Anna-Maria Behnsen <anna-maria@...utronix.de>,
Miroslav Lichvar <mlichvar@...hat.com>, Werner Abt <werner.abt@...nberg-usa.com>,
David Woodhouse <dwmw2@...radead.org>, Stephen Boyd <sboyd@...nel.org>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Kurt Kanzenbach <kurt@...utronix.de>, Nam Cao <namcao@...utronix.de>,
Antoine Tenart <atenart@...nel.org>
Subject: Re: [patch V3 01/11] timekeeping: Update auxiliary timekeepers on
clocksource change
On Wed, Jun 25, 2025 at 11:38 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> Propagate a system clocksource change to the auxiliary timekeepers so that
> they can pick up the new clocksource.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> kernel/time/timekeeping.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
> ---
>
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -119,8 +119,10 @@ static struct tk_fast tk_fast_raw ____c
>
> #ifdef CONFIG_POSIX_AUX_CLOCKS
> static __init void tk_aux_setup(void);
> +static void tk_aux_update_clocksource(void);
> #else
> static inline void tk_aux_setup(void) { }
> +static inline void tk_aux_update_clocksource(void) { }
> #endif
>
> unsigned long timekeeper_lock_irqsave(void)
> @@ -1548,6 +1550,8 @@ static int change_clocksource(void *data
> timekeeping_update_from_shadow(&tk_core, TK_UPDATE_ALL);
> }
>
> + tk_aux_update_clocksource();
> +
> if (old) {
> if (old->disable)
> old->disable(old);
> @@ -2651,6 +2655,30 @@ EXPORT_SYMBOL(hardpps);
> #endif /* CONFIG_NTP_PPS */
>
> #ifdef CONFIG_POSIX_AUX_CLOCKS
> +
> +/* Bitmap for the activated auxiliary timekeepers */
> +static unsigned long aux_timekeepers;
> +
Nit: Would it be useful to clarify this is accessed without locks, and
the related tks->clock_valid *must* be checked while holding the lock
before using a timekeeper that is considered activated in the
aux_timekeepers bitmap?
Otherwise,
Acked-by: John Stultz <jstultz@...gle.com>
Powered by blists - more mailing lists