[ntp:questions] no ntp synchronisation: 2s to 6s time shift !

Evandro Menezes evandro at mailinator.com
Fri Feb 15 17:29:04 UTC 2008

On Feb 12, 4:40 pm, David Woolley
<da... at ex.djwhome.demon.co.uk.invalid> wrote:
> tsc refers to the counter in recent Intel Architecture chips that counts
> the processor clock cycles.  It is somewhat vulnerable to power management.

Not only PM, but also differences between processor cores.  Some
models of multi-core processors from AMD or Intel provide one TSC per
core, which may cause discrepancies when the TSC is read on one core
at a time tick and on another core at the next time tick.  This is
also true for multi-processor systems: TSCs are not guaranteed to be
correlated among processors, not even their relative monotonicity.

The Linux kernel goes through hoops to account for such discrepancies
among the several TSC instances, but it's never 100% successful
neither 100% accurate.

Using the TSC as a time reference is tempting because reading it takes
just a few CPU cycles to read it.  Other time references, such as ACPI-
PM and HPET, take much longer to read, even 1000X longer, though they
provide consistent reads and accuracy no matter from which processor
or core.

The speed to get the time-of-day from the kernel may be important when
running some applications, such as data-base servers, when every
transaction is time-tagged and the time it takes to get the time-of-
day can contribute significantly to its performance.

Therefore, for time-keeping purposes, it's better to avoid the kernel
from using the TSC as its time-reference, in favor of other timers
available in the system, unless running an application whose
performance may be gated by getting the time-of-day.


More information about the questions mailing list