Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2011 22:41:53 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220581 - head/sys/x86/isa
Message-ID:  <201104122241.p3CMfrhY037768@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104122241.p3CMfrhY037768>