Linux – TSC missing from available clocksources

centos6clock-synchronizationkernellinux

Not sure why TSC as a clock source is not available?

cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
hpet acpi_pm

The CPU I'm using is Intel Xeon(R) X5570 @ 2.93GHz. The motherboard is Supermicro X8DTU-F. Running CentOS 6.3 2.6.32-279.22.1.el6.x86_64.

Not happy with the performance of hpet or acpi_pm measured using the following program.

#include <time.h>
main()
{
    int rc;
    long i;
    struct timespec ts;

    for(i=0; i<10000000; i++) {
        rc = clock_gettime(CLOCK_MONOTONIC, &ts);
    }
}

With hpet as the clock source

time ./clock_timing
real    6m25.761s
user    6m23.456s
sys     0m0.403s

With acpi_pm as the clock source

time ./clock_timing
real    10m12.057s
user    0m6.615s
sys     10m2.549s

Update

cat /proc/cmdline

ro root=UUID=72903706-30bf-4285-9016-d24cf2066d3c rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=132M@0M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM vga=788 consoleblank=0 clocksource_failover=acpi_pm

grep flags /proc/cpuinfo

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida dts tpr_shadow vnmi flexpriority ept vpid

Best Answer

Some pre-Westmere Intel CPU have a somewhat flawed TSC capability, maybe this is your case and the kernel is blacklisting the TSC as a timer source. Issue the following command

dmesg | grep -i tsc

and report here the output.