FULL AI ANALYSIS

systemd timer misses periodic jobs after resume — clock jumps forward on resume when host uses TSC as RTC

Generated Oct 20, 2026, 9:41:02 AM

Analysis summary

systemd uses the system clock and relies on clocksource consistency. If the hardware TSC drifts or is not synchronized after suspend, kernel steps the clock on resume which can cause systemd to delay or 'miss' timer invocations. Using a steady clocksource (e.g., hpet or tsc stable on modern hardware) or ensuring timesyncd updates clock non-step (slew) can help. Persistent timers depend on systemd detecting missed elapses — but large immediate clock steps can confuse ordering. The working diagnostic (switching clocksource to hpet) confirms clocksource instability is likely root. Another contributor can be aggressive NTP step behavior.

Possible causes

TSC or chosen kernel clocksource produces an inconsistent time after suspend/resume causing systemd to step the clock and timers to be delayed

80%

systemd-timesyncd (or other NTP client) steps the clock abruptly after resume due to large offset, causing timers to be rescheduled

50%

Bug in kernel resume path or platform firmware leaving RTC inaccurate so kernel must correct time on resume

35%

Timers configured with a wide AccuracySec and Persistent=false that legitimately don't run during sleep and are not expected to run until next tick

25%

Suggested fixes

1

Diagnostic step 1

Test with alternative clocksource temporarily: echo hpet | sudo tee /sys/devices/system/clocksource/clocksource0/current_clocksource and suspend/resume to see if timers behave. If improved, consider making the change persistent or patching kernel cmdline with clocksource=hpet (use with caution on laptops where hpet may be slow).

2

Diagnostic step 2

Configure timesyncd/ntpd to prefer slew (no-step) corrections on resume if supported, or use chrony which handles slewing better: replace systemd-timesyncd with chrony and enable makestep/step-tolerance settings carefully.

3

Diagnostic step 3

Ensure systemd timers that must run immediately after resume use OnUnitActiveSec with Persistent=true as appropriate, and add OnCalendar as backup; add a small ExecStartPre check to catch missed work.

4

Diagnostic step 4

If the hardware/firmware is known to be flaky, file vendor bug and consider a kernel upgrade; escalate to platform vendor if clocksource remains unstable after kernel updates.