]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Improve the implementation of adjtime(2).
authorPoul-Henning Kamp <phk@FreeBSD.org>
Mon, 15 Apr 2002 12:23:11 +0000 (12:23 +0000)
committerPoul-Henning Kamp <phk@FreeBSD.org>
Mon, 15 Apr 2002 12:23:11 +0000 (12:23 +0000)
commite1d970f1811e5e1e9c912c032acdcec6521b2a6d
tree733a8aba038268bb9bbfe0becf82c0d69fb2477b
parent52a3cde55dd89880b2996627881329b463f81a7a
Improve the implementation of adjtime(2).

Apply the change as a continuous slew rather than as a series of
discrete steps and make it possible to adjust arbitraryly huge
amounts of time in either direction.

In practice this is done by hooking into the same once-per-second
loop as the NTP PLL and setting a suitable frequency offset deducting
the amount slewed from the remainder.  If the remaining delta is
larger than 1 second we slew at 5000PPM (5msec/sec), for a delta
less than a second we slew at 500PPM (500usec/sec) and for the last
one second period we will slew at whatever rate (less than 500PPM)
it takes to eliminate the delta entirely.

The old implementation stepped the clock a number of microseconds
every HZ to acheive the same effect, using the same rates of change.

Eliminate the global variables tickadj, tickdelta and timedelta and
their various use and initializations.

This removes the most significant obstacle to running timecounter and
NTP housekeeping from a timeout rather than hardclock.
sys/kern/kern_ntptime.c
sys/kern/kern_tc.c
sys/kern/kern_time.c
sys/kern/subr_param.c
sys/sys/kernel.h