Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2011 13:52:47 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@FreeBSD.org
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject:   Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86
Message-ID:  <201105091352.49971.jkim@FreeBSD.org>
In-Reply-To: <201105091734.p49HY0P3006180@svn.freebsd.org>
References:  <201105091734.p49HY0P3006180@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_xnCyNZcCSRePH+t
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Monday 09 May 2011 01:34 pm, Jung-uk Kim wrote:
> Author: jkim
> Date: Mon May  9 17:34:00 2011
> New Revision: 221703
> URL: http://svn.freebsd.org/changeset/base/221703
>
> Log:
>   Implement boot-time TSC synchronization test for SMP.  This test
> is executed when the user has indicated that the system has
> synchronized TSCs or it has P-state invariant TSCs.  For the former
> case, we may clear the tunable if it fails the test to prevent
> accidental foot-shooting.  For the latter case, we may set it if it
> passes the test to notify the user that it may be usable.

For now, we don't change TSC quality.  However, if it goes well, I am 
planning on committing the attached patch to change that.  If you 
experience any false detections, please report to me privately.

Please also note that we don't test TSC drifts across cores at 
run-time, so we may have to leave SMP TSC quality as is, i.e., 800.  
It is yet to be determined.  Please let me know what you think.

Thanks!

Jung-uk Kim

--Boundary-00=_xnCyNZcCSRePH+t
Content-Type: text/plain;
  charset="iso-8859-1";
  name="tc_qualities.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="tc_qualities.diff"

Index: sys/dev/acpica/acpi_hpet.c
===================================================================
--- sys/dev/acpica/acpi_hpet.c	(revision 221701)
+++ sys/dev/acpica/acpi_hpet.c	(working copy)
@@ -476,7 +476,7 @@ hpet_attach(device_t dev)
 		sc->tc.tc_get_timecount = hpet_get_timecount,
 		sc->tc.tc_counter_mask = ~0u,
 		sc->tc.tc_name = "HPET",
-		sc->tc.tc_quality = 900,
+		sc->tc.tc_quality = 950,
 		sc->tc.tc_frequency = sc->freq;
 		sc->tc.tc_priv = sc;
 		tc_init(&sc->tc);
Index: sys/dev/acpica/acpi_timer.c
===================================================================
--- sys/dev/acpica/acpi_timer.c	(revision 221701)
+++ sys/dev/acpica/acpi_timer.c	(working copy)
@@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev)
     if (j == 10) {
 	acpi_timer_timecounter.tc_name = "ACPI-fast";
 	acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount;
-	acpi_timer_timecounter.tc_quality = 1000;
+	acpi_timer_timecounter.tc_quality = 900;
     } else {
 	acpi_timer_timecounter.tc_name = "ACPI-safe";
 	acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe;
Index: sys/x86/x86/tsc.c
===================================================================
--- sys/x86/x86/tsc.c	(revision 221703)
+++ sys/x86/x86/tsc.c	(working copy)
@@ -385,7 +385,7 @@ test_smp_tsc(void)
 	if (bootverbose)
 		printf("SMP: %sed TSC synchronization test\n",
 		    smp_tsc ? "pass" : "fail");
-	return (smp_tsc ? 800 : -100);
+	return (smp_tsc ? 1000 : -100);
 }
 
 #undef N
@@ -422,9 +422,13 @@ init_TSC_tc(void)
 	 * synchronized.  If the user is sure that the system has synchronized
 	 * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
 	 */
-	if (smp_cpus > 1)
+	if (smp_cpus > 1) {
 		tsc_timecounter.tc_quality = test_smp_tsc();
+		goto init;
+	}
 #endif
+	if (tsc_is_invariant)
+		tsc_timecounter.tc_quality = 1000;
 init:
 	if (tsc_freq != 0) {
 		tsc_timecounter.tc_frequency = tsc_freq;

--Boundary-00=_xnCyNZcCSRePH+t--



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