Re: [PATCH] Fix TSC calibration issues

From: Linus Torvalds
Date: Wed Sep 03 2008 - 22:57:33 EST




On Wed, 3 Sep 2008, Alok Kataria wrote:
>
> As Linus suggested, we should be moving the tsc_read_refs outside of the
> loop, this gives us more accurate TSC calibration when calibrating against
> hpet/pmtimer, since we are now calibrating over a period of 250ms.

Side note: I'd like to change that.

250ms is a _loong_ time. It's a really really long time. It's
human-noticeable. A quarter of a second at boot is just too long.

We have a couple of options:

- make the PIT calibration shorter

I suspect we could easily make the PIT calibration be just 5ms rather
than 50ms. Yes, yes, it will be less precise, but the PIT counts at
1.1MHz or something, so we're still talking about 5000+ ticks of the
clock.

So we'll get within a fraction of a percent. We could then decide that
_if_ the HPET/PMTIMER matches the PIT, we'll decide to use that as the
reference time, because it would possibly have higher accuracy.

- do other things while calibrating.

Especially for HPET/PM_TIMER, we could actually do some other stuff
while it is calibrating, since those calibrations only depend on the
end/beginning being "close enough". This seems like it would be pretty
hard to actually do sanely, though (there's still the issue of the
HPET/PM_TIMER overflowing, although with 24 bits that should be on the
order of several seconds, I dunno)

Anyway, 250ms really is too long.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/