3

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

  • Check your kernel command line. – Michael Hampton Apr 10 '15 at 8:11
  • grep tsc /proc/cpuinfo can help you – c4f4t0r Apr 10 '15 at 9:15
  • hi guys, I updated the question with the outputs. I don't see anything unusual in /proc/cmdline and the CPU does TSC. – sudoer Apr 10 '15 at 10:35
3

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.

  • hi, good point! I did see some references in /var/log/messages that the kernel has switched to using hpet because of the unstableness of tsc. I guess I may have to change the CPUs to see if the problem goes away. I'l mark your answer as accepted once I confirm that is the case. Thanks. – sudoer Apr 14 '15 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.