Re: AMD X2 unsynced TSC fix?

Vojtech Pavlik
2006-10-28T09:16:26Z

On Fri, Oct 27, 2006 at 08:59:13PM -0700, Andi Kleen wrote:

> > There are few problems at hand. I'm not familiar with the patch Andi's
> > talking about but it has to solve all these problems to be really useful:
>
> It's from Jiri and Vojtech. Basically it will allow to use RDTSC
> in gettimeofday even with unsynchronized TSCs by keeping
> the necessary offsets CPU local.
>
> Drawback: for vsyscall you need RDTSCP, this means AMD F stepping
> at least. But even as a syscall it will be still faster than before.
>
> > * TSC skew across CPUs at bootup (Linux handles this already)
>
> Just not very good. There is still a significant error when it's done.
>
> > * TSC drift across CPUs at the "same" frequency (pretty constant, minimal)
>
> It just adds up over time.
>
> > * TSC drift because of PM states, such as C1 (hlt) (semi-random, severe)
>
> TSC drift with powernow -- CPUs run at different frequencies

And the patch does exactly that.

It doesn't assume much about TSCs, except that they're individually
monotonic and that without a warning (cpufreq notifier, c1 state
enter/leave) the frequency doesn't change quickly. Slow frequency drift
(spread spectrum modulation, thermal effects on Xtal) is compensated for.

We still are testing the patch and fixing the issues we find, currently
with our cpufreq handling, but I believe we're on a good way to have it
working well.

--
Vojtech Pavlik
Director SuSE Labs