From: Thomas Gleixner <tglx@linutronix.de>
To: Alok Kataria <akataria@vmware.com>
Cc: johnstul@us.ibm.com, mingo@redhat.com, andi@firstfloor.org,
linux-kernel@vger.kernel.org, Dan Hecht <dhecht@vmware.com>,
Tim Mann <mann@vmware.com>, Zachary Amsden <zach@vmware.com>
Subject: Re: Possible error in tsc frequency calibration
Date: Wed, 14 May 2008 15:07:26 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.1.10.0805141506010.3174@apollo.tec.linutronix.de> (raw)
In-Reply-To: <1210719921.11510.157.camel@promb-2n-dhcp368.eng.vmware.com>
On Tue, 13 May 2008, Alok Kataria wrote:
> I was looking at the tsc calibration code (tsc_calibrate) in the recent
> kernels (2.6.26-rc1). With the newer code of calibrating against the
> pm_timer and with the added checks for SMI's the tsc_calibration code
> looks pretty robust, at least for x86_64 systems.
>
> However, from the code, (tsc_calibrate) SMI_THRESHOLD is 50000, so in
> the worst case, values returned by tsc_read_refs, i.e. tsc1 & tsc2,
> could be off by 50000 ticks. On a 2Ghz processor this would mean an
> error of 25us. The tsc frequency is calibrated over a period of 50ms;
> hence the worst case error can be around 500ppm.
>
> In addition to that, the pmtimer hardware itself has some drift,
> typically in the range of 20 to 100ppm. If this drift happens to be in
> the same direction as the error in measuring the tsc against the
> pmtimer, we could have a total error of more than 500ppm in the tsc
> frequency calibration code. The maximum drift that NTP is willing to
> correct is 500ppm. So we can have cases when we may end up
> mis-calibrating tsc frequency beyond the NTP threshold.
>
> One thing that we can do to reduce this possible error is to
> double the calibration period from the current 50msec to 100msec.
> This halves the maximum error to 250ppm.
Will have a look at the threshold when working on #2
> Comments?
>
> Now looking at the 32bit code, the frequency calibration code looks
> really broken in the sense that we are not checking for SMI's at all.
> The maximum error that can go undetected on these systems is very high.
> The best way to solve this would be to unify the calibration code for 32
> bit and 64bit. Is anybody already working on this?
#2 Yup, I'm merging tsc-32/64 and keep the 64 bit calibration for both.
Thanks,
tglx
prev parent reply other threads:[~2008-05-14 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 23:05 Alok Kataria
2008-05-14 13:07 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.1.10.0805141506010.3174@apollo.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=akataria@vmware.com \
--cc=andi@firstfloor.org \
--cc=dhecht@vmware.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mann@vmware.com \
--cc=mingo@redhat.com \
--cc=zach@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®