From owner-svn-src-all@FreeBSD.ORG Mon May 9 17:53:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 2363E1065686; Mon, 9 May 2011 17:53:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 9 May 2011 13:52:47 -0400 User-Agent: KMail/1.6.2 References: <201105091734.p49HY0P3006180@svn.freebsd.org> In-Reply-To: <201105091734.p49HY0P3006180@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_xnCyNZcCSRePH+t" Message-Id: <201105091352.49971.jkim@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 17:53:03 -0000 --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--