diff options
author | John Stultz <johnstul@us.ibm.com> | 2010-07-28 00:00:00 (GMT) |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2010-12-03 00:48:37 (GMT) |
commit | 08ec0c58fb8a05d3191d5cb6f5d6f81adb419798 (patch) | |
tree | 9dd292575c8b349300ba837a8103cbd9235a5b4f /net/caif/cfcnfg.c | |
parent | b0f969009f647cd473c5e559aeec9c4229d12f87 (diff) | |
download | linux-08ec0c58fb8a05d3191d5cb6f5d6f81adb419798.tar.xz |
x86: Improve TSC calibration using a delayed workqueue
Boot to boot the TSC calibration may vary by quite a large amount.
While normal variance of 50-100ppm can easily be seen, the quick
calibration code only requires 500ppm accuracy, which is the limit
of what NTP can correct for.
This can cause problems for systems being used as NTP servers, as
every time they reboot it can take hours for them to calculate the
new drift error caused by the calibration.
The classic trade-off here is calibration accuracy vs slow boot times,
as during the calibration nothing else can run.
This patch uses a delayed workqueue to calibrate the TSC over the
period of a second. This allows very accurate calibration (in my
tests only varying by 1khz or 0.4ppm boot to boot). Additionally this
refined calibration step does not block the boot process, and only
delays the TSC clocksoure registration by a few seconds in early boot.
If the refined calibration strays 1% from the early boot calibration
value, the system will fall back to already calculated early boot
calibration.
Credit to Andi Kleen who suggested using a timer quite awhile back,
but I dismissed it thinking the timer calibration would be done after
the clocksource was registered (which would break things). Forgive
me for my short-sightedness.
This patch has worked very well in my testing, but TSC hardware is
quite varied so it would probably be good to get some extended
testing, possibly pushing inclusion out to 2.6.39.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <1289003985-29060-1-git-send-email-johnstul@us.ibm.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@elte.hu>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
CC: Clark Williams <williams@redhat.com>
CC: Andi Kleen <andi@firstfloor.org>
Diffstat (limited to 'net/caif/cfcnfg.c')
0 files changed, 0 insertions, 0 deletions