diff options
author | Anna-Maria Behnsen <anna-maria@linutronix.de> | 2024-02-21 10:05:43 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-02-22 17:52:32 +0100 |
commit | 89f01e10c99a5ca2ff88b545fad763d360cdbfc8 (patch) | |
tree | 95a0039719094661e2575b24c03c51bbfea39e77 /kernel | |
parent | timers: Restructure internal locking (diff) | |
download | linux-89f01e10c99a5ca2ff88b545fad763d360cdbfc8.tar.xz linux-89f01e10c99a5ca2ff88b545fad763d360cdbfc8.zip |
timers: Check if timers base is handled already
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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240221090548.36600-16-anna-maria@linutronix.de
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/timer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 51053af64023..4420cdf59e8c 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2285,6 +2285,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); |