[ntp:questions] PPS jitter in Linux

Mike S mikes at flatsurface.com
Mon Apr 2 23:28:10 UTC 2012


I've got a Trimble Thunderbolt PPS source for NTP, Linux 2.6.35, on a 
quad core CPU. PPS source is coming into a multiport serial card, which 
/proc/interrupts shows is sharing IRQ with some inactive USB ports (IRQ 
17).

Running normally, I'll get about +- 20 us ptp of jitter (as reported by 
ntpq -p, and in loopstats). If I load up the CPU, jitter will shrink to 
+- 1-3 us. I've played around with different cpufreq setting, thinking 
it might be related to the processor speed during an IRQ, but that seems 
to have minimal impact (performance vs. conservative vs. ondemand).

I've also tried irqbalance, no change in performance.

But running a process(es) which keep the CPU completely busy reduces the 
jitter. The busier, the better (load average >4 is swell). Why? I'm 
guessing it has something to do with interrupt latency, but why does a 
busy CPU make it more consistent, I'd expect the opposite? The 
difference is very obvious.

Is there something else I can do to keep the jitter low?

Aside: I also patched the kernel to allow statically setting the TSC 
frequency ( 
http://old.nabble.com/-PATCH--tsc_khz%3D-boot-option-to-avoid-TSC-calibration-variance-td23494975.html 
). This eliminates the semi-random, 30-40 ppm change in NTP reported 
frequency between reboots. After tweaking, it's now consistently < 1 us. 
This should be in the mainline kernel! The jitter mentioned above was no 
different before/after, though, as expected.


More information about the questions mailing list