Re: [PATCH v8 09/25] timer: Split out get next timer functionality

From: Thomas Gleixner
Date: Mon Oct 09 2023 - 18:17:16 EST


On Wed, Oct 04 2023 at 14:34, Anna-Maria Behnsen wrote:
> Split out get next timer functionality to make it reusable in other
> places. Thereby the order of getting the next expiry, forwarding the base
> clock and mark timer bases as idle, is changed. This change of order
> shouldn't have any impact, as nothing inside the function relies on the
> idle value or the updated timer base clock.

This interestingly corrects the issue of patch 8/25 because

> + nextevt = __get_next_timer_interrupt(basej, base);
>
> /*
> * We have a fresh next event. Check whether we can forward the
> @@ -1952,14 +1968,10 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
> */
> base->is_idle = time_after(nextevt, basej + 1);

base->is_idle is now handled in the correct order vs. the nextevt evaluation.

> - if (base->timers_pending) {
> - /* If we missed a tick already, force 0 delta */
> - if (time_before(nextevt, basej))
> - nextevt = basej;
> - expires = basem + (u64)(nextevt - basej) * TICK_NSEC;
> - }
> raw_spin_unlock(&base->lock);

Thanks,

tglx