summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2011-04-12 22:41:52 +0000
committerjkim <jkim@FreeBSD.org>2011-04-12 22:41:52 +0000
commit2092a06579f29873b4c1f7e4a294dfc71e455844 (patch)
tree7c0abe482531b7bbd01df56d85c05ecfdb716aa8 /sys/x86
parent69382ad6929a850565f339c2aab52e63d50def3c (diff)
downloadFreeBSD-src-2092a06579f29873b4c1f7e4a294dfc71e455844.zip
FreeBSD-src-2092a06579f29873b4c1f7e4a294dfc71e455844.tar.gz
Do not use TSC for DELAY(9) if it not P-state invariant to avoid possible
foot-shooting. DELAY() becomes unreliable when TSC frequency varies wildly, especially cpufreq(4) and powerd(8) are used at the same time.
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/isa/clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c
index d82dad7..5556ee6 100644
--- a/sys/x86/isa/clock.c
+++ b/sys/x86/isa/clock.c
@@ -263,7 +263,7 @@ delay_tc(int n)
tc = timecounter;
freq = atomic_load_acq_64(&tsc_freq);
- if (freq != 0) {
+ if (tsc_is_invariant && freq != 0) {
func = get_tsc;
mask = ~0u;
} else {
OpenPOWER on IntegriCloud