svn commit: r220581 - head/sys/x86/isa

Jung-uk Kim jkim at FreeBSD.org
Tue Apr 12 22:41:53 UTC 2011


Author: jkim
Date: Tue Apr 12 22:41:52 2011
New Revision: 220581
URL: http://svn.freebsd.org/changeset/base/220581

Log:
  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.

Modified:
  head/sys/x86/isa/clock.c

Modified: head/sys/x86/isa/clock.c
==============================================================================
--- head/sys/x86/isa/clock.c	Tue Apr 12 22:22:01 2011	(r220580)
+++ head/sys/x86/isa/clock.c	Tue Apr 12 22:41:52 2011	(r220581)
@@ -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 {


More information about the svn-src-head mailing list