From e94d5ad227abd9acd71bf4ca8230530017833a14 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 12 Apr 2011 22:41:52 +0000 Subject: [PATCH] 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(-) diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c index d82dad7f4948..5556ee651a7f 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 {