HomeFreeBSD

kern_tc.c: Scaling/large delta recalculation

Description

kern_tc.c: Scaling/large delta recalculation

This change is a slight performance optimization for systems with a slow
64-bit division.

The th->th_scale and th->th_large_delta values only depend on the
timecounter frequency and the th->th_adjustment. The timecounter
frequency of a timehand only changes when a new timecounter is activated
for the timehand. The th->th_adjustment is only changed by the NTP
second update. The NTP second update is not done for every call of
tc_windup().

Move the code block to recalculate the scaling factor and
the large delta of a timehand to the new helper function
recalculate_scaling_factor_and_large_delta().

Call recalculate_scaling_factor_and_large_delta() when a new timecounter
is activated and a NTP second update occurred.

MFC after: 1 week

Details

Provenance
sebastian.huber_embedded-brains.deAuthored on Oct 28 2021, 8:22 AM
kibCommitted on Oct 28 2021, 9:31 PM
Parents
rGa901f2af587f: libradius: fix WITHOUT_OPENSSL build
Branches
Unknown
Tags
Unknown