Timers and timing, was: MySQL Performance 6.0rc1

Jiawei Ye leafy7382 at gmail.com
Fri Oct 28 02:48:21 PDT 2005


On 10/28/05, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
>
> By default the timecounter with the highest score is selected (but
> negative scores are never selected automatically).
>
> You can override this with
>         sysctl kern.timecounter.hardware=something
> where something is one of the timecounters listed in kern.timecounter.choice
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
This is what I get on a UP P4-1.8 -current system. No debugging enabled kernel.

root at chihiro:/home/leafy/tmp# sysctl kern.timecounter.hardware=TSC
kern.timecounter.hardware: ACPI-fast -> TSC
root at chihiro:/home/leafy/tmp# ./a.out
       null function: 0.00794
            getpid(): 0.94267
              time(): 1.26512
      gettimeofday(): 1.25332
root at chihiro:/home/leafy/tmp# sysctl kern.timecounter.hardware=ACPI-fast
kern.timecounter.hardware: TSC -> ACPI-fast
root at chihiro:/home/leafy/tmp# ./a.out
       null function: 0.00796
            getpid(): 0.94788
              time(): 2.31868
      gettimeofday(): 2.29598
root at chihiro:/home/leafy/tmp# sysctl kern.timecounter.hardware=i8254
kern.timecounter.hardware: ACPI-fast -> i8254
root at chihiro:/home/leafy/tmp# ./a.out
       null function: 0.00812
            getpid(): 0.96921
              time(): 5.01022
      gettimeofday(): 5.01292

--
"Without the userland, the kernel is useless."
               --inspired by The Tao of Programming


More information about the freebsd-current mailing list