The clock skew bug is evidently caused by the inability of the host to
generate SIGALRMs at the frequency HZ because of its low resolution
(host HZ = 100). So lags add up in milliseconds and there's no
differenciation between say HZ=52 and HZ=60. Both result in an actual
frequency of b/w 40 and 50 Hz depending on the load.
I have a solution that fixes this for the basic test case. It uses the
Time Stamp Counter to disperse fluctuations in the delay.
Here are some results:
Sleep 30 Sleep 60
HZ=52 31.261 63.412
HZ=80 48.070 137.990
HZ=50 30.068 60.124
HZ=52 30.021 60.021
HZ=80 30.027 60.027
HZ=50 30.006 60.040
Here's an independent program that simulates this-
Does this seem reasonable? If so, I'll diff and post a patch.