Google Sends Patches For AMD Zen / Zen 2 RAPL PowerCap Support

Written by Michael Larabel in AMD on 29 July 2020 at 08:07 AM EDT. 3 Comments
AMD
Building off the work sent out by Google engineers in recent months and merged for Linux 5.8 around RAPL support for AMD Zen / Zen 2 CPUs with supporting the "runtime average power limiting" counters on Linux similar to Intel's longstanding support, that work has continued now with Zen RAPL support in the PowerCap driver.

Google engineer Victor Ding sent out a set of patches this morning for AMD Zen / Zen 2 RAPL support within the PowerCap Linux driver that allows power capping of the CPU(s) if so desired and some new interfaces via sysfs.

The support amounts to less than 50 lines of new code as the RAPL counters exposed by AMD Zen/Zen2 CPUs operate in a similar manner to the Intel RAPL support that has long offered working Linux support. More details on the kernel's power capping framework can be found via the kernel documentation.

With re-using all of the existing Intel code paths, existing Linux power capping tools and other programs tapping the /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj and /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj interfaces will "just work" with the AMD Ryzen / EPYC processors.

It's a pity it took this long for the support to materialize, but at least it's finally coming thanks to the work by Google engineers. The Linux 5.9 merge window is kicking off potentially next week already, so it may be too close for getting it into this next version of the kernel, but we'll see if it squeezes in at the last minute given the rather simplicity of the patches.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week