Re: clock works slowly when I change CPU speed

From: MATOBA Hirozumi <matoba_at_st.rim.or.jp>
Date: Sat, 16 Aug 2003 12:06:21 +0900 (JST)
 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_at_repoman.freebsd.org>
| | >> From: Poul-Henning Kamp <phk_at_FreeBSD.org>
| | >> Date: Wed, 6 Aug 2003 08:05:28 -0700 (PDT)
| | >> To: src-committers_at_FreeBSD.org, cvs-src_at_FreeBSD.org,
| | >>         cvs-all_at_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_at_st.rim.or.jp
Received on Fri Aug 15 2003 - 18:10:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:19 UTC