still problems with kernel PLL in Linux 1.3.83 (long)

Ulrich Windl (windl@rkdvmhp4.dvm.klinik.uni-regensburg.de)
Wed, 10 Apr 1996 10:40:52 +0200 (MESZ)


I still have some problems with the NTP kernel clock implementation in
Linux 1.3.83. Using only a DCF77 reference clock, the time offset does
not settle around zero, but around some positive value near 1/2 tick
(0.005 seconds). The reference clock's disperson is roughly at 0.005
(between 0.004 and 0.008). This is true even when the drift is
absolutely stable since established for the very first time (drift is
77.8567).

One effect is that the "sysinfo" in xntpdc never shows a stability
below 1ppm; also the frequency never settles to some specific
value. The clock's precision is displayed at about -17.

Example of "sysinfo":
system peer: GENERIC(0)
system peer mode: client
leap indicator: 00
stratum: 1
precision: -18
root distance: 0.00000 s
root dispersion: 0.01030 s
reference ID: [DCFa]
reference time: b5122e98.420c49b0 Sun, Apr 7 1996 14:07:52.258
system flags: auth monitor pll stats kernel_sync
frequency: 48.000 ppm
stability: 52.989 ppm
broadcastdelay: 0.003906 s
authdelay: 0.000030 s

Watching the offset of the clock suggests that the first derivation is
rather constant (even though the kernel PLL should "flatten the drift"
in my opinion). Here's a plot after a reboot:

Clock offset [sec]
0.02 ++------------+------------+-------------+------------+------------++
+ + + + + +
| "offset.out" *A** |
| |
| A |
| A A *A ** A |
| * ** A A A * A * A ** |
0.01 ++ A * A * ** ** * * * * ** A * A ++
| * * * * A * A * A * A * A * * * * |
| * ** ** * * * * ** ** * A * A |
| A A A A * ** A A ** ** |
| * * A A A A |
| ** * |
0 ++**.*.............................................................++
| ** * |
| * * |
| * A |
| * |
| * |
| * |
-0.01 ++* ++
| * |
| * |
| * |
| * |
| * |
-0.02 ++* ++
|* |
|* |
|* |
|* |
|* |
|* |
-0.03 +* ++
|* |
|* |
|* |
|* |
|* |
-0.04 +* ++
|* |
|* |
|* |
|A |
| |
+ + + + + +
-0.05 ++------------+------------+-------------+------------+------------++
30500 31000 31500 32000 32500 33000

Examining the state of the kernel clock is strange, too. The frequency
is mostly at 100ppm (it is continuously climbing until 100ppm), but
jumps down for short intervals; there's no gradual change. The pll
offset is always at 0us (which seems strange). Here's the output of a
"kerninfo":

pll offset: 0 us
pll frequency: 100.000 ppm
maximum error: 14964 us
estimated error: 10864 us
status: 0001
pll time constant: 2
precision: 1 us
frequency tolerance: 100 ppm
pps frequency: 0.000 ppm
pps stability: 100.000 ppm
pps jitter: 800 us
calibration interval: 4 s
calibration cycles: 0
jitter exceeded: 0
stability exceeded: 0
calibration errors: 0

It seems the kernel clock's frequency is never adjusted. Finally I'll
show an other sysinfo and a longer interval of clock offsets:

system peer: GENERIC(0)
system peer mode: client
leap indicator: 00
stratum: 1
precision: -18
root distance: 0.00000 s
root dispersion: 0.00795 s
reference ID: [DCFa]
reference time: b5123218.420c49b0 Sun, Apr 7 1996 14:22:48.258
system flags: auth monitor pll stats kernel_sync
frequency: 48.000 ppm
stability: 52.074 ppm
broadcastdelay: 0.003906 s
authdelay: 0.000030 s

0.03 ++-------+-------+--------+-------+--------+-------+--------+------++
+ + + + + + + + +
| : : : : : : "loops" *A** |
| : : : : : : : |
| : : A : : : : : |
| : : * : : : : : |
0.02 ++.................*...............................................++
| : :** : : : : : |
| : :** : : : : : |
| : :** A : : : : : |
| A AA: :** A*A AA : : : : |
| AAAAAAA AA * * *A*AAAAAAA : : : : |
0.01 ++.A******AA*A.AA*.*.A*A****AAAAA.A..A.A....A.A.A..A.A..A..A.A.....++
| *AAAAAA*AA*AAAA * *A*A*AA****AA*AAAA*AA A*A*A*AA*A* A*AAAA*A |
| *******AA*AA*** AA**A*A**AAAA**A*A**A*AAAA*AA*AA*AAA*A*A**A* |
| AAA*AA*****A*AA A*AA AA:A****AA*A*AA*A*AA*A**A*AA*A***A*AA*A |
| * A AA*AA**** *** A :AA AA**A*A**AA*A**AAA*A**A*AAA*A**A* |
| * : A AAA: *A* : A AA*AA*A*A*AA*A*A*AA*A*A*A*AA*A |
0 ++.*................*A...........A.A..A.A.A..A.A.A..A.A.A.A..AA....++
| * : : * : : : : : |
| A : : A : : : : : |
| * : : : : : : : |
| * : : : : : : : |
-0.01 ++.*...............................................................++
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
-0.02 ++.*...............................................................++
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
-0.03 ++*................................................................++
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
| * : : : : : : : |
-0.04 ++*................................................................++
| * : : : : : : : |
| * : : : : : : : |
| A : : : : : : : |
| : : : : : : : |
+ + + + + + + + +
-0.05 ++-------+-------+--------+-------+--------+-------+--------+------++
30000 32000 34000 36000 38000 40000 42000 44000 46000

Here's an other graph after a reboot. After initial synchronization,
the reference clock failed for a short time (near 64000). After a
short initial phase the offset is always positive:

Offset [sec] from DCF77
0.02 ++-----+------+-----+------+------+------+------+-----+------+-----++
+ + + + + + + + + + +
| "loops" *A** |
| |
| |
| |
0.015 ++ ++
| A |
| * |
| ** |
| A A* A A A A |
| A * ** A * A * A * * A A |
0.01 ++ * * * * ** * * ** * A* A ** * * ++
| * ** * * * * * * A* * ** * A* A ** * |
| ** A* A * * * ** ** A **** **** ** * A* A |
| ** * ** * * * * *** * **A* * A* * ** ** * |
| ** * ** ** * * *** * * ** *A ** * A* * ** |
| *A * * A * A *** ** A ** ** * *A ** * *A |
0.005 ++ * A * * AAA * * *AA ** * ** * ** * *A ** ++
| * * A A *A * ** ** A * A ** * ** ** |
| * * * ** A ** * * * A ** * |
| * * * ** ** * A A * A |
| * ** ** ** A A |
| * * * ** |
0 ++........*..*..............*.....*................................++
| * A * * |
| * A * |
| * * |
| * * |
| * A |
-0.005 ++ * ++
| * |
| * |
| * |
| * |
+ + * + + + + + + + + +
-0.01 ++-----+--*---+-----+------+------+------+------+-----+------+-----++
62500 63000 63500 64000 64500 65000 65500 66000 66500 67000 67500

For the first section I've also monitored the kernel PLL's frequency:
PLL Frequency Kernel PLL frequency
5.7e+06 ++-------+---------+--------+---------+--------+---------+-------++
+ + + + + + + +
| : : : : : "../yyy" *A** |
| : : : : : : |
| : : : : : : |
5.6e+06 ++...............................................................++
| : : : : : : A |
| : : : : : : AA |
| : : : : : : AA |
| : : : : : AAAAAAA |
5.5e+06 ++..................................................AAA..........++
| : : : : : * : |
| : : : : : AA : |
| : : : : : AA : |
| : : : : :AAA : |
5.4e+06 ++...................................AAAAAAAAAAAA................++
| : : : AA: : : |
| : : : * : : : |
| : : : * : : : |
5.3e+06 ++................................AA.............................++
| : : : * : : : |
| : : : AA : : : |
| : : : AA : : : |
| : : : AA : : : |
5.2e+06 ++.............................*.................................++
| : : : * : : : |
| : : : AA : : : |
| : : AA : : : |
| : : AAA : : : |
5.1e+06 ++........AAAAAAAAAAAAAAAAA......................................++
| :* : : : : : |
| :* : : : : : |
| :* : : : : : |
+ +* + + + + + +
5e+06 ++-------+*--------+--------+---------+--------+---------+-------++
8.2907e+08.2907e+088.29071e+0829072e+08.29072e+0829072e+08.29073e+0874e+08
UNIX time [sec]