Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Aug 2003 12:06:21 +0900 (JST)
From:      MATOBA Hirozumi <matoba@st.rim.or.jp>
To:        thorsten.greiner@web.de
Cc:        nate@root.org
Subject:   Re: clock works slowly when I change CPU speed
Message-ID:  <20030816.120621.846933691.matoba@st.rim.or.jp>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
 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 <phk@FreeBSD.org>
| | >> 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



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