From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 20:30:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id EA73C106566B; Tue, 14 Dec 2010 20:30:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 14 Dec 2010 15:30:33 -0500 User-Agent: KMail/1.6.2 References: <201012142007.oBEK7pLd028994@svn.freebsd.org> In-Reply-To: <201012142007.oBEK7pLd028994@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012141530.40603.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216443 - in head/sys: amd64/amd64 dev/acpica i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:30:49 -0000 On Tuesday 14 December 2010 03:07 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Dec 14 20:07:51 2010 > New Revision: 216443 > URL: http://svn.freebsd.org/changeset/base/216443 > > Log: > Stop lying about supporting cpu_est_clockrate() when TSC is > invariant. This function always returned the nominal frequency > instead of current frequency because we use RDTSC instruction to > calculate difference in CPU ticks, which is supposedly constant for > the case. Now we support cpu_get_nominal_mhz() for the case, > instead. Note it should be just enough for most usage cases > because cpu_est_clockrate() is often times abused to find maximum > frequency of the processor. Actually, I wanted to support cpu_est_clockrate() as well and the following was my naive attempt: http://people.freebsd.org/~jkim/tsc.diff Unfortunately, it only worked for AMD64 Family 0Fh and below where we don't need this hack at all. I tried everything I could (e.g., fooling around with branch prediction) but it constantly gave me better MHz for under-clocked cases. :-/ Jung-uk Kim