[tip: timers/urgent] clocksource: Prevent immediate watchdog rerun after a delay
From: tip-bot2 for Karl Mehltretter
Date: Tue Oct 27 2026 - 16:32:39 EST
The following commit has been merged into the timers/urgent branch of tip:
Commit-ID: f322d7f7ae56bce728ba03a387e35380bc4ad939
Gitweb: https://git.kernel.org/tip/f322d7f7ae56bce728ba03a387e35380bc4ad939
Author: Karl Mehltretter <kmehltretter@xxxxxxxxx>
AuthorDate: Mon, 26 Oct 2026 02:02:00 +01:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Tue, 27 Oct 2026 21:26:16 +01:00
clocksource: Prevent immediate watchdog rerun after a delay
The watchdog rewrite made the clocksource check handle long intervals
between two measurements, but missed that the timer expiry needs to be
rebased after such a delay.
When a watchdog invocation is delayed by more than one interval, adding
WATCHDOG_INTERVAL to the previous expiry leaves the timer expiry in the
past. That causes an immediate second invocation. The resulting short
measurement interval can mark a clocksource unstable.
Cure this by rearming the timer based on jiffies, which places the next
expiry one full watchdog interval into the future.
Fixes: 763aacf86f1b ("clocksource: Rewrite watchdog code completely")
Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Link: https://patch.msgid.link/20261026010200.96371-1-kmehltretter@xxxxxxxxx
Closes: https://lore.kernel.org/r/20261010065509.72916-1-kmehltretter@xxxxxxxxx/
---
kernel/time/clocksource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index f1253f5..58c0ca1 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -673,7 +673,7 @@ static void clocksource_watchdog(struct timer_list *unused)
/* Could have been rearmed by a stop/start cycle */
if (!timer_pending(&watchdog_timer)) {
- watchdog_timer.expires += WATCHDOG_INTERVAL;
+ watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL;
add_timer_local(&watchdog_timer);
}
}