2024-01-15 14:38:15

by Anna-Maria Behnsen

[permalink] [raw]
Subject: [PATCH v10 01/20] timers: Restructure get_next_timer_interrupt()

get_next_timer_interrupt() contains two parts for the next timer interrupt
calculation. Those two parts are separated by forwarding the base
clock. But the second part does not depend on the forwarded base
clock.

Therefore restructure get_next_timer_interrupt() to keep things together
which belong together.

No functional change.

Signed-off-by: Anna-Maria Behnsen <[email protected]>
---
kernel/time/timer.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 352b161113cd..5f21db4fa3ca 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1937,12 +1937,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
if (base->next_expiry_recalc)
next_expiry_recalc(base);

- /*
- * We have a fresh next event. Check whether we can forward the
- * base.
- */
- __forward_timer_base(base, basej);
-
if (base->timers_pending) {
nextevt = base->next_expiry;

@@ -1960,6 +1954,12 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
base->next_expiry = nextevt;
}

+ /*
+ * We have a fresh next event. Check whether we can forward the
+ * base.
+ */
+ __forward_timer_base(base, basej);
+
/*
* Base is idle if the next event is more than a tick away.
*
--
2.39.2



2024-01-17 15:01:57

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [PATCH v10 01/20] timers: Restructure get_next_timer_interrupt()

Le Mon, Jan 15, 2024 at 03:37:24PM +0100, Anna-Maria Behnsen a ?crit :
> get_next_timer_interrupt() contains two parts for the next timer interrupt
> calculation. Those two parts are separated by forwarding the base
> clock. But the second part does not depend on the forwarded base
> clock.
>
> Therefore restructure get_next_timer_interrupt() to keep things together
> which belong together.
>
> No functional change.
>
> Signed-off-by: Anna-Maria Behnsen <[email protected]>

Reviewed-by: Frederic Weisbecker <[email protected]>