AMD RAPL PowerCap Patches Updated For Linux - Now Include Family 19h (Zen 3)
Patches from a Google engineer allow run-time average power limiting (RAPL) support for AMD Zen processors within the Linux PowerCap driver.
Earlier this year was AMD Zen RAPL support in the Perf subsystem while this more recent activity for AMD RAPL has been about the PowerCap code. The Linux PowerCap framework was originally conceived by Intel but AMD Zen CPUs have similar MSRs available for supporting limiting the CPU TDP and also reading the current energy usage. With these patches /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj is the latest way of exposing the AMD CPU energy usage under Linux.
Back in July we covered the AMD Zen RAPL PowerCap patches by Google's Victor Ding. Now though he sent out a new series. With this latest code for exposing the AMD RAPL counters the notable change is adding a new patch for Family 19h support -- Zen 3.
The Family 19h MSRs around the RAPL counters turn out to be identical to Family 17h (Zen / Zen 2) CPUs and so is extended to work on these forthcoming processors. These latest patches are now out on the kernel mailing list.
It's rather close to seeing the code land for Linux 5.10 given its merge window is opening up in a few days but otherwise this straight-forward code will hopefully be in Linux 5.11.