Re: gettimeofday() jumping into the future

Thomas Gleixner
2008-04-03T06:29:00Z

On Thu, 3 Apr 2008, Karsten Wiese wrote:
> > To prevent this TSC specific wreckage we need to compare the TSC value
> > against the reference value and return the latter when it is larger
> > than the actual TSC value.
>
> Last paragraph IMO should be:
> To prevent this TSC specific wreckage we need to substract the
> reference value from the TSC value, interpret the result as
> signed. If the interpreted result is negative, return the reference
> value, else the TSC Value.
> Your patch misses the corner case where TSC value is < reference _and_ valid
> at TSC wrap around.

In about 200 years on a 3Ghz box.

> The access to the reference value needs a (the xtime ?) lock on 32bit, no?

The readout is under xtime lock anyway.

Thanks,

tglx