Re: [patch V3 10/11] timekeeping: Provide update for auxiliary timekeepers

From: John Stultz
Date: Fri Jun 27 2025 - 01:05:53 EST


On Wed, Jun 25, 2025 at 11:38 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> Update the auxiliary timekeepers periodically. For now this is tied to the system
> timekeeper update from the tick. This might be revisited and moved out of the tick.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> kernel/time/timekeeping.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
> ---
>
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -2762,6 +2766,20 @@ static void tk_aux_update_clocksource(vo
> }
> }
>
> +static void tk_aux_advance(void)
> +{
> + unsigned long active = READ_ONCE(aux_timekeepers);
> + unsigned int id;
> +
> + for_each_set_bit(id, &active, BITS_PER_LONG) {
> + struct tk_data *tkd = &timekeeper_data[id + TIMEKEEPER_AUX_FIRST];

Again, a nit, but I'd use aux_tkd or something just to be super clear
we're using aux ones here.

> +
> + guard(raw_spinlock)(&tkd->lock);
> + if (tkd->shadow_timekeeper.clock_valid)
> + __timekeeping_advance(tkd, TK_ADV_TICK);
> + }
> +}

Otherwise,
Acked-by: John Stultz <jstultz@xxxxxxxxxx>