3 Replies Latest reply on Nov 22, 2017 10:14 AM by Intel Corporation

    i7-7820X, bad TSC frequency on Linux (3,60 GHz vs 3,75 GHz)

    cat01101

      Hello,

       

      I'm having a serious problem with this CPU on Linux. This problem affects many things, making the system almost unusable.

      It's "time stretching", which makes time intervals proportionally bigger if the TSC is used as a clocksource.

      For example, 60 sec becomes ~62,5 secs, I confirmed this with a physical stop-watch to be absolutely sure.

       

      Kernel version is 4.10 (Ubuntu 16.04.3 LTS), using newest kernel doesn't change a thing.

      I tried clocksource=hpet kernel cmdline option as the main workaround, and other options ("lapic=notscdeadline tsc=noirqtime notsc") which are supposed to reduce TSC usage.

      With HPET clocksource, clocks work seemingly normal, system works much better.

       

      I also measured TSC frequency.

      In the first (bad) case, TSC frequency is assumed by the kernel to be 3,75 GHz.

      In the second case (HPET), measuring TSC gives a hint that its frequency is, in fact, 3,6 GHz.

      Note that 3,75 / 3,6 relation is equal to 62,5 / 60.

       

      I took a look at Linux kernel sources, particularly at the code which provides TSC frequency for modern CPUs.

       

      linux/tsc.c at 3c073991eb417b6f785ddc6afbbdc369eb84aa6a · torvalds/linux · GitHub

       

      This code uses different Crystal Hz values for Skylake Desktop (24000) and Skylake X (25000).

      25000 / 24000 is again equal to 3,75 / 3,6.

      Modifying this value in kernel also helps, the system works much better with clocksource=tsc.

       

      I'm totally unsure, either CPUID values are invalid for 7820X, or Linux kernel simply doesn't support this CPU yet?

      Thanks in advance.