Messages in this thread Patch in this message | | | From | Anna-Maria Behnsen <> | Subject | [PATCH v11 15/20] timers: Check if timers base is handled already | Date | Wed, 21 Feb 2024 10:05:43 +0100 |
| |
Due to the conversion of the NOHZ timer placement to a pull at expiry time model, the per CPU timer bases with non pinned timers are no longer handled only by the local CPU. In case a remote CPU already expires the non pinned timers base of the local CPU, nothing more needs to be done by the local CPU. A check at the begin of the expire timers routine is required, because timer base lock is dropped before executing the timer callback function.
This is a preparatory work, but has no functional impact right now.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> --- v10: s/cpu/CPU/ in commit message
v6: Drop double negation --- kernel/time/timer.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 52af50d00ae6..7b9f9ed25fc2 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2240,6 +2240,9 @@ static inline void __run_timers(struct timer_base *base) lockdep_assert_held(&base->lock); + if (base->running_timer) + return; + while (time_after_eq(jiffies, base->clk) && time_after_eq(jiffies, base->next_expiry)) { levels = collect_expired_timers(base, heads); -- 2.39.2
| |