Page MenuHomeFreeBSD

FFclock: ffclock_windup reorganisation
Needs ReviewPublic

Authored by Darryl.Veitch_uts.edu.au on Dec 7 2023, 12:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 11, 11:49 PM
Unknown Object (File)
Sep 18 2024, 2:30 AM
Unknown Object (File)
Sep 7 2024, 9:13 PM
Unknown Object (File)
Sep 7 2024, 8:25 AM
Unknown Object (File)
Aug 17 2024, 4:04 PM
Unknown Object (File)
Jul 28 2024, 1:34 PM
Unknown Object (File)
Jul 4 2024, 1:27 AM
Unknown Object (File)
May 12 2024, 6:02 AM
Subscribers

Details

Reviewers
phk
imp
Summary

Context: the FFclock mechanism supports more than one kind of FF clock.
The foundation is the "native" FF clock (natFFC) synchronized by the
FFclock daemon. This clock is not guaranteed to be causal (monotonically
increasing). The FFclock therefore also makes available a monotonized
form (monoFFC), used as the basis of normal system clock read functions.

This commit improves the structure and clarity of the core FFclock code.
Comment blocks are improved throughout, including the consistent use of
natFFC and monoFFC terminology. The naming convention _lerp, and _LERP
for monoFF variables and constants is replaced by _mono and _MONO.

The majority of the changes are in the core function ffclock_windup.
It has been reorganised to improve :

  • separation of natFFC and monoFFC processing
  • separation of code needed for each tc-tick, from code which depends on whether the daemon has updated the natFFC data since the last tick.
  • efficiency: some code was executed needlessly or repeatedly.
  • alignment with the structure of ffclock_change_tc.

Addition of update code for a new bintime member, "tick_error", of
struct fftimehands, that tracks the evolution of a bound on the error
of natFCC. It is efficient to calculate this per-tick in ffclock_windup
leveraging existing calculations.
This member is used in sysclock_getsnapshot to reduce snapshot overhead,
down to zero in the fast case.

Other changes in ffclock_windup :

  • gap_lerp replaced by the neater "gap".
  • new verbosity to flag the exceptional jump case of monoFFC updating.

kern_tc.c:ffclock_init

  • adding explicit null initialization of global ffclock_boottime

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54832
Build 51721: arc lint + arc unit

Event Timeline

brooks added inline comments.
sys/kern/kern_ffclock.c
245

While you're here you might go ahead and remove the no longer required empty lines after nonexistent variable declarations.

sys/kern/kern_tc.c
612

We don't generally use // comments.

667