linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG]Uncalibrated TSC is not accurate enough as a time keeper
@ 2018-12-23  6:56 Da Shi Cao
  2018-12-27 17:35 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Da Shi Cao @ 2018-12-23  6:56 UTC (permalink / raw)
  To: linux-kernel, linux-x86_64

The cpu_khz and tsc_khz are now read directly by the cpuid
instruction, and they are deemed to be very accurate. But this is not
the case in our situation. The OS time lags behind about 8 seconds per
hour. The CPU information is as follows:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping        : 4
microcode       : 0x200004d
cpu MHz         : 2300.000
cache size      : 25344 KB
physical id     : 0
siblings        : 36
core id         : 0
cpu cores       : 18
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
It is this "cpuid level 22" that makes the kernel 4.14 to read both
cpu_khz and tsc_khz directly by instruction "cpuid", and the TSC is
thought to be very accurate, but in fact it is not.
------------
* TSC frequency determined by CPUID is a "hardware reported"
* frequency and is the most accurate one so far we have. This
* is considered a known frequency.
+*
+*  The assumption may not be valid!
+*
*/
-  setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG]Uncalibrated TSC is not accurate enough as a time keeper
  2018-12-23  6:56 [BUG]Uncalibrated TSC is not accurate enough as a time keeper Da Shi Cao
@ 2018-12-27 17:35 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2018-12-27 17:35 UTC (permalink / raw)
  To: Da Shi Cao; +Cc: linux-kernel, linux-x86_64

* Da Shi Cao:

> The cpu_khz and tsc_khz are now read directly by the cpuid
> instruction, and they are deemed to be very accurate. But this is not
> the case in our situation. The OS time lags behind about 8 seconds per
> hour. The CPU information is as follows:

Is virtualization involved?  Do you use a vendor kernel?

Note that <linux-x86_64@vger.kernel.org> is more or less dead, and
your message to linux-kernel might get lost in the flood.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-27 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-23  6:56 [BUG]Uncalibrated TSC is not accurate enough as a time keeper Da Shi Cao
2018-12-27 17:35 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).