From owner-freebsd-current@FreeBSD.ORG Thu Apr 7 20:01:23 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410081065673; Thu, 7 Apr 2011 20:01:23 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 17D9D8FC13; Thu, 7 Apr 2011 20:01:23 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p37K1Lhv069960 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 7 Apr 2011 13:01:22 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4D9E1831.4040707@freebsd.org> Date: Thu, 07 Apr 2011 13:01:53 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Andriy Gapon References: <4D9DF086.9020906@FreeBSD.org> In-Reply-To: <4D9DF086.9020906@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD current Subject: Re: prefer tsc timecounter when it's good X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2011 20:01:23 -0000 On 4/7/11 10:12 AM, Andriy Gapon wrote: > Guys, > > what do you think about the following change? > The idea is mark TSC as the best timecounter when it's invariant and synchronized > between cores. > Unfortunately I don't have code to auto-detect the synchronization and keep > relying on the corresponding tunable. I thought about auto-setting it for > single-package configurations, but even that information is currently not trivial > to get out of our mp (i386/amd64) machdep code. > > --- a/sys/x86/x86/tsc.c > +++ b/sys/x86/x86/tsc.c > @@ -169,6 +169,9 @@ init_TSC_tc(void) > printf("TSC timecounter disabled: APM enabled.\n"); > } > > + if (tsc_is_invariant) > + tsc_timecounter.tc_quality = 1200; I like this. I have to set the timecounter to TSC manually on my machines as using teh default (fast-acpi) slows my tests down by 10%-20% mind you if one were to be able to put the tunable into /boot, one could put the sysctl into /etc/sysctl.conf to do the same thing.. > + > #ifdef SMP > /* > * We can not use the TSC in SMP mode unless the TSCs on all CPUs >