Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1367801

[PATCH 0/9] x86: TSC calibration update

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Len Brown <lenb@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 0/9] x86: TSC calibration update
Date Thu, 31 Mar 2016 06:20:02 +0200
Message-ID <riCfn-7Lb-3@gated-at.bofh.it> (permalink)
X-Original-To x86@kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=zmNgAvI/7WgVSG/B8DMCQnZ1fHSG4AHPdiQ9vVKcQLU=; b=eoRbsRwqnexHxLz/1R2i9QBt84COjsEvEEdX/V1Ev+F6y8uLEGvtuWWd//QSKmRVAl cgmOlnhZE9IPdf7o+Vm3KuLDrcChq4soRrc/HRnzXMkKswQVvMw87kxEMsWpaHc9kRfT I6oeDnSZb1GrAJF5+WxdqNO29msbqYjOi97XOPWfRVLXSw6NV/R8kQQkFiBtY7LYhIQj Ov7zA405/SUsk04HR0tfcDoZp+ycrCxQSfrDgknb2ftwf8Nf8dhQW1dm6SU0vmE0kQKb jxUGYRDl72SfV8bHFSUmppromHUCSlad0TgPbounMDejdZFgJCvJlLvQOuVsusNXm/kF xF0g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=zmNgAvI/7WgVSG/B8DMCQnZ1fHSG4AHPdiQ9vVKcQLU=; b=CfDfaXRMXdTInD5dBBvAnblVJs5HroxnWxMr7rFrtN3STLOKtHR7t1azCeXyArNNvm Q01R4TojdMy4QAm0J5550B/3qUu1vBJZN6x9PqlYZ76kOrRUA9P/4oH4cc8l8RNyfzON ZO8w16IBScB3rdI7T+WFdntFepAvl3Jx0bsR9qIaNju80yuCOMvoeRmggiz33EKsQq4z /CduDT0LshMsDKul/xXMhfNzv5Io/vdktZIF/nMZkoAl+/OjiMWdPwZYrsjaatL3J7YA a9JCQpIQSuJzZxiJjdAM/IMI7b1/TrG8crMKRB0wzO2+gJ3LQMiVUsTJ9BuFHGW+rqDL q6TQ==
X-Gm-Message-State AD7BkJIo/ra1NOu8Ut+s+om4krt64FzlvV9FGBjIR8XFr7RvWNUwxp8oIu5IGbpw5TshHg==
X-Received by 10.37.22.197 with SMTP id 188mr6531951ybw.98.1459397669542; Wed, 30 Mar 2016 21:14:29 -0700 (PDT)
X-Mailer git-send-email 2.8.0.rc4.16.g56331f8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 52
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org
X-Original-Date Thu, 31 Mar 2016 00:13:46 -0400
X-Original-Message-ID <1459397635-4871-1-git-send-email-lenb@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1367801

Show key headers only | View raw


cpu_khz and tsc_khz initialization can be unreliable and expensive.
They are initialized in tsc_init()/native_calibrate_tsc(), which prints:

pr_info("Detected %lu.%03lu MHz processor\n", cpu_khz...)

native_calibrate_cpu() first tries quick_pit_calibrate(),
which can take over 50.0M cycles to succeed,
or as few as 2.4M cycles to fail.

On failure, pit_calibrate_tsc() is attempted, which can succeed
in as few as 20M cycles, but may consume over 240M cycles
before it fails.

By comparison, on many processors, tsc frequency can be discovered by
table and MSR or CPUID in under 0.002M cycles.

Subsequently tsc_refine_calibration_work() checks our work,
but it takes under 0.004M cycles.

pr_info("Refined TSC clocksource calibration: %lu.%03lu MHz\n", tsc_khz...)

Finally, CPU and TSC frequency are not guaranteed to be identical,
and this series allows cpu_khz and tsc_khz to differ
within a few percent.

cheers,
Len Brown, Intel Open Source Technology Center

this patch set is also available via git:

git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git x86


Bin Gao (1):
      x86 tsc: enumerate BXT tsc_khz via CPUID

Len Brown (8):
      x86 tsc_msr: Identify Intel-specific code
      x86 tsc_msr: Remove debugging messages
      x86 tsc_msr: Update comments, expand definitions
      x86 tsc_msr: Correct Silvermont reference clock values
      x86 tsc_msr: Add Airmont reference clock values
      x86 tsc_msr: Extend to include Intel Core Architecture
      x86 tsc_msr: Remove irqoff around MSR-based TSC enumeration
      x86 tsc: enumerate SKL cpu_khz and tsc_khz via CPUID

 arch/x86/include/asm/tsc.h      |   4 +-
 arch/x86/include/asm/x86_init.h |   4 +-
 arch/x86/kernel/tsc.c           |  96 ++++++++++++++++++++++++++++++----
 arch/x86/kernel/tsc_msr.c       | 112 ++++++++++++++++++++++------------------
 arch/x86/kernel/x86_init.c      |   1 +
 5 files changed, 152 insertions(+), 65 deletions(-)

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] x86: TSC calibration update Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200
  [PATCH 6/9] x86 tsc_msr: Extend to include Intel Core Architecture Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200
  [PATCH 2/9] x86 tsc_msr: Remove debugging messages Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200
  [PATCH 9/9] x86 tsc: enumerate BXT tsc_khz via CPUID Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200
  [PATCH 4/9] x86 tsc_msr: Correct Silvermont reference clock values Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200
  [PATCH 5/9] x86 tsc_msr: Add Airmont reference clock values Len Brown <lenb@kernel.org> - 2016-03-31 06:20 +0200

csiph-web