]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
In tc_windup, handle the case where the previous call to tc_windup was
authorcperciva <cperciva@FreeBSD.org>
Mon, 22 Nov 2010 09:13:25 +0000 (09:13 +0000)
committercperciva <cperciva@FreeBSD.org>
Mon, 22 Nov 2010 09:13:25 +0000 (09:13 +0000)
commit6cdc82f90731dd5c361708b204ef977079a6a146
tree7eeada262b358d7d01b66418e625a174d131b1a4
parent46e50a7603917cf17df6f85004e94e846f192e37
In tc_windup, handle the case where the previous call to tc_windup was
more than 1s earlier.  Prior to this commit, the computation of
th_scale * delta (which produces a 64-bit value equal to the time since
the last tc_windup call in units of 2^(-64) seconds) would overflow and
any complete seconds would be lost.

We fix this by repeatedly converting tc_frequency units of timecounter
to one seconds; this is not exactly correct, since it loses the NTP
adjustment, but if we find ourselves going more than 1s at a time between
clock interrupts, losing a few seconds worth of NTP adjustments is the
least of our problems...
sys/kern/kern_tc.c