From owner-freebsd-current@FreeBSD.ORG Fri Aug 15 20:10:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB6AF37B404 for ; Fri, 15 Aug 2003 20:10:07 -0700 (PDT) Received: from serio.al.rim.or.jp (serio.al.rim.or.jp [202.247.191.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06DA643F75 for ; Fri, 15 Aug 2003 20:10:02 -0700 (PDT) (envelope-from matoba@st.rim.or.jp) Received: from mail5.rim.or.jp by serio.al.rim.or.jp (3.7W/HMX-13) id MAA05816; Sat, 16 Aug 2003 12:09:59 +0900 (JST) Received: from localhost (ntkngw093034.kngw.nt.adsl.ppp.infoweb.ne.jp [220.209.101.34]) by mail5.rim.or.jp (8.9.3/3.7W) id MAA21996; Sat, 16 Aug 2003 12:09:58 +0900 (JST) Date: Sat, 16 Aug 2003 12:06:21 +0900 (JST) Message-Id: <20030816.120621.846933691.matoba@st.rim.or.jp> To: thorsten.greiner@web.de From: MATOBA Hirozumi In-Reply-To: <20030815205047.GA719@tybalt> <20030816.022701.730550600.matoba@st.rim.or.jp> <11229.1060970608@critter.freebsd.dk> References: <11229.1060970608@critter.freebsd.dk> <1060978640.603.11.camel@localhost> <20030815205047.GA719@tybalt> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: phk@phk.freebsd.dk cc: freebsd-current@FreeBSD.org cc: nate@root.org Subject: Re: clock works slowly when I change CPU speed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sat, 16 Aug 2003 03:10:08 -0000 On Fri, 15 Aug 2003 22:50:47 +0200 Thorsten Greiner wrote: | $ dmesg | grep counter | Timecounter "i8254" frequency 1193182 Hz | Timecounter "ACPI-fast" frequency 3579545 Hz | Timecounter "TSC" frequency 1595302164 Hz | $ sysctl -w kern.timecounter.hardware=i8254 | Fixes the problem for me. I suspect you should set this in | /etc/sysctl.conf to enable it permanently. Thank you for your advice. I compared the behaviors of the 2 kernel in the quoted mail below (I wrote) about Timecounter in dmesg and about value of kern.timecounter.hardware, then I understood the mail On Fri, 15 Aug 2003 20:03:28 +0200 "Poul-Henning Kamp" wrote: >> You should not be using the TSC for timekeeping if you change the >> frequency of it. means. On my ThinkPad A22e, 3 kind of Timecounters appear in dmesg. Between 2 kernels, both of about appeaing order in dmesg and about the default value of kern.timecounter.hardware differ. On kernel with the previous revision of these 3 file: $ dmesg | grep counter Timecounter "i8254" frequency 1193182 Hz Timecounter "TSC" frequency 797048080 Hz Timecounter "ACPI-fast" frequency 3579545 Hz Timecounters tick every 10.000 msec $ sysctl kern.timecounter.hardware kern.timecounter.hardware: ACPI-fast On kernel with the latest (on Aug 13) revision of these 3 files: $ dmesg | grep counter Timecounter "i8254" frequency 1193182 Hz Timecounter "ACPI-fast" frequency 3579545 Hz Timecounter "TSC" frequency 797048048 Hz Timecounters tick every 10.000 msec $ sysctl kern.timecounter.hardware kern.timecounter.hardware: TSC So, on kernel with the latest (on Aug 13) revision of these 3 files, after executing sysctl -w kern.timecounter.hardware=ACPI-fast the clock works normally for any CPU speed settings, successfully. I will put it in /etc/sysctl.conf :-) # Does kernel choose the Timecounter which detects recently # as the default value of kern.timecounter.hardware? On Sat, 16 Aug 2003 02:27:01 +0900 (JST) I wrote: | I changed 3 files in quoted mail below (tsc.c clock.h clock.c) | back to the previous revision, | on my ThinkPad A22e (the last cvsup was on Aug 13), | and recompiled kernel (the config file is almost the same as GENERIC), | and compared behavior of the clock between 2 kernels as: | | kernel with the latest (on Aug 13) revision of these 3 files | kernel with the previous revision of these 3 file | | | >> Message-Id: <200308061505.h76F5Sih048392@repoman.freebsd.org> | | >> From: Poul-Henning Kamp | | >> Date: Wed, 6 Aug 2003 08:05:28 -0700 (PDT) | | >> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, | | >> cvs-all@FreeBSD.org | | >> X-FreeBSD-CVS-Branch: HEAD | | >> Subject: cvs commit: src/sys/i386/i386 tsc.c src/sys/i386/include clock.h | | >> src/sys/i386/isa clock.c | | >> | | >> phk 2003/08/06 08:05:28 PDT | | >> | | >> FreeBSD src repository | | >> | | >> Modified files: | | >> sys/i386/i386 tsc.c | | >> sys/i386/include clock.h | | >> sys/i386/isa clock.c | | >> Log: | | >> Dont initialize a TSC timecounter until we know if it is broken or not. | | >> | | >> Revision Changes Path | | >> 1.201 +6 -0 src/sys/i386/i386/tsc.c | | >> 1.45 +1 -0 src/sys/i386/include/clock.h | | >> 1.201 +1 -0 src/sys/i386/isa/clock.c -- matoba@st.rim.or.jp