summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorKarl Mehltretter <kmehltretter@gmail.com>2026-10-26 02:02:00 +0100
committerThomas Gleixner <tglx@kernel.org>2026-10-27 21:26:16 +0100
commitf322d7f7ae56bce728ba03a387e35380bc4ad939 (patch)
tree84eade7e48f3911a13674bf1f6eb1509874fa044 /kernel/time
parentcbd0f65b48f52d308c457b0fd5201324abadb501 (diff)
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@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261026010200.96371-1-kmehltretter@gmail.com Closes: https://lore.kernel.org/r/20261010065509.72916-1-kmehltretter@gmail.com/
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clocksource.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index f1253f5795c6..58c0ca11cdc5 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);
}
}