Announcement

Collapse
No announcement yet.

Kaby Lake On Linux Plays Much Better With CPUFreq Than P-State

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    phoronix I have a i7-4980HQ Haswell Process in a 2015 MacBook Pro 11,5. I build custom kernels to address bugs and quirks on this platform, but have noticed this exact kind of performance discrepancy between p_state enabeld and cpufreq performance.

    In p_state mode, my MacBook Pro consistently throttles back down from 2.8 GHz w Turbo Boost 3.8 GHz to a 800 MHz to 1600 MHz base state - on system start-up, everything is fast and happy. After a while thought, it makes sense that there should be thermal throttling; but even after the CPU is back at 50~60 degrees, the system fans have returned to ~50% of max speed, no amount of activity can provoke the CPU to increase the clock-speed past 1600 MHz on any given core. After a long period of the system being on, the processor can also be stuck at 800 MHz, with nothing else to do but to reboot to temporarily solve the issue. The performance differential is noticeable when building the Linux kernel from source, which is what got me started on this investigation. Toggling between the two governors (powersave/performance) is only a "recommendation" to the system, the CPU/firmware can decide to put itself into power-save mode.

    If you look into how p_state is meant to work on Haswell, it turns out you have very little control over what the processor is doing, between your system firmware (which can manage the performance) and processor in built thermal protection. I suspect my specific problem may be related to the fact it's a Mac and whatever control the firmware has over the processor state is not communicating with the p_state driver correctly in the Linux kernel; or it's overriding any instruction from the OS if it's not OS X. No amount of activity can push the CPU back into performance mode, it never reaches it's base max frequency of 2.8 GHz. The result is that I get pretty great battery life out of the MacBook while travelling on a plane, but the lack of speedy performance for professional tasks is frustrating.

    In the "Bay" family processors, this is meant to be controlled exclusively by the CPU with "Hardware P-State" (see hyperlink). The fact you've essentially replicated the performance problems I'm experiencing seems to indicate something is up.

    If I disable p_state and return to cpufreq; I get all the scheduling control I could ever want; except for the fact Turbo Boost is disabled in this mode, which results in a locked max frequency of 2.8 GHz. At the moment, that is better than nothing, but getting the top of the line CPU to exploit the higher performance of turbo boost is disappointing, particularly when there appears to be no legitimate thermal reason that the CPU is getting locked while in p_state mode.

    Just thought I'd add my two cents in; I've been using (sensors/cpuinfo) to monitor this during testing under work loads, and the reality is very sad. It may not be exactly related; but it did spike my interested enough to leave my experience in corroboration to your findings.


    Code:
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    cpu MHz        : 800.000
    
    Left side  : 3035 RPM  (min = 2160 RPM, max = 6156 RPM)
    Right side : 2800 RPM  (min = 2000 RPM, max = 5700 RPM)
    
    Core 0:         +61.0°C  (high = +84.0°C, crit = +100.0°C)
    Core 1:         +67.0°C  (high = +84.0°C, crit = +100.0°C)
    Core 2:         +60.0°C  (high = +84.0°C, crit = +100.0°C)
    Core 3:         +63.0°C  (high = +84.0°C, crit = +100.0°C)

    Comment


    • #22
      I reported bug https://bugzilla.redhat.com/show_bug.cgi?id=1410755 against fedora 25 because its Linux 4.8 wouldn't correctly detect my overclocked i7-6850k's frequency limits. It thought the CPU would only clock upto to 4.0 GHz (and even then it topped out at 3.8 GHz). That same processor clocks up to 4.4 GHz on Linux 3.16 (debian), 4.4 (ubuntu 16.04), and whatever Centos 7.3 runs. Windows 10 also runs the CPU fine at 4.4 GHz.

      If the cpu maximum frequency is misdetected then that bounds overclocking. Perhaps that's happening with your 7600k not because of the CPU but because there's a bug in the most recent kernels (4.8 and later). Might be interesting to look at the CPU frequency limits discussed in the bug to see if they match the actual part.

      Comment


      • #23
        I reported bug 1410755 at bugzilla.redhat.com against fedora 25 because its Linux 4.8 wouldn't correctly detect my overclocked i7-6850k's frequency limits. It thought the CPU would only clock upto to 4.0 GHz (and even then it topped out at 3.8 GHz). That same processor clocks up to 4.4 on Linux 3.16 (debian), 4.4 (ubuntu 16.04), and whatever Centos 7.3 runs. Windows 10 also runs the CPU fine at 4.4 GHz.

        If the cpu maximum frequency is misdetected then that bounds overclocking. Perhaps that's happening with your 7600k not because of the CPU but because there's a bug in the most recent kernels (4.8 and later). Might be interesting to look at the CPU frequency limits discussed in the bug to see if they match the actual part.

        Comment


        • #24
          Originally posted by phoronix View Post
          Phoronix: Kaby Lake On Linux Plays Much Better With CPUFreq Than P-State

          After ordering a Core i5 7600K Kaby Lake CPU last week, I've been spending the past few days trying it out under Ubuntu Linux. If you happened to pick up an early Kaby Lake CPU and seeing low performance, I wanted to pass along a little PSA while I am still working on additional tests.

          http://www.phoronix.com/vr.php?view=24009
          what kind of heatsink have u used? thanks.

          Comment


          • #25
            I have created CoreFreq especially to monitor w/ Linux the turbo frequency of my i7
            It's an open-source built around a msr driver which gathers rt data straight from the cores.
            It is available on GitHub (github.com/cyring/CoreFreq)
            Cheers

            Comment

            Working...
            X