HomeFreeBSD

timerfd: Fix interval callout scheduling

Description

timerfd: Fix interval callout scheduling

When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.

Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.

This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55790
MFC after: 2 weeks

Details

Provenance
jfreeAuthored on Mar 20 2026, 6:33 AM
Reviewer
markj
Differential Revision
D55790: timerfd: Fix interval callout scheduling
Parents
rG834c1ba793d9: timerfd: Add tests
Branches
Unknown
Tags
Unknown