Re: TSC to Mono-raw Drift

From: Thomas Gleixner
Date: Fri Oct 19 2018 - 14:37:29 EST


On Fri, 19 Oct 2018, Thomas Gleixner wrote:
> On Mon, 15 Oct 2018, Christopher Hall wrote:
> > TSC kHz used to calculate mult/shift value: 3312000
>
> Now the most interesting information here would be the resulting mult/shift
> value which the kernel uses. Can you please provide that?

But aside of the actual values it's pretty obvious why this happens. It's a
simple rounding error. Minimal, but still. To avoid rounding errors you'd
have to find mult and shift values which exactly result in:

(freq * mult) >> shift = 1e9

which is impossible for freq = 3312 * 1e6.

A possible fix for this is, because the error is in the low PPB range, to
adjust the error once per second or in some other sensible regular
interval.

John?

Thanks,

tglx