From 2092a06579f29873b4c1f7e4a294dfc71e455844 Mon Sep 17 00:00:00 2001 From: jkim Date: Tue, 12 Apr 2011 22:41:52 +0000 Subject: 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. --- sys/x86/isa/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/x86/isa') 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 { -- cgit v1.1