Linux 5.17 is here and just around the corner for Arch users who dont build their own Kernels and have it already. Even if you do here is the short and easy of using the new P-State Driver for AMD CPUs. Ondemand seems to deliver the best performance/power savings over schedutil with p-state at the moment.
It should be noted this is only for Zen2 and newer
First check if support is already enabled with lscpu | grep cppc
if you get no output then to 2
Make sure CPPC is enabled in your BIOS/UEFI, some its on by default others its not.
Most non-Epyc systems will need to add one or both of these to your kernel command line
Enable shared mem mode (This is not Required for Ryzen 7000 series+ and most laptop 5000/6000 series)
EDIT: amd-pstate=passive is now required for kernels 6.1+
Pstate driver doesnt load automatically you can do this to load it on boot
by creating a file
and thats it, you should be using the new AMD P-State driver. Im not sure if the driver is lying to me but it reports that it allows my CPU to idle down to 550mhz. My main concern with this is just any little bit of power savings it can bring as thats its purpose. Enjoy the new driver
Make sure the module is enabled when building the kernel:
And in case you run into issue and the module cannot be loaded, you can get some more detailed information when you do sudo modprobe amd_pstate dyndbg==pmf -v and then check what is logged with sudo dmesg
I decided to test but its not working for me… Not sure why, running a 5600x on a Asus motherboard.
Module/Kernel version/Kernel cmdline
# modprobe amd_pstate dyndbg==pmf -v
insmod /lib/modules/5.17.1-zen1-1-zen/kernel/drivers/cpufreq/amd_pstate.ko.zst shared_mem=1 enable=1 dyndbg==pmf
$ uname -a
Linux eos 5.17.1-zen1-1-zen #1 ZEN SMP PREEMPT Mon, 28 Mar 2022 21:56:46 +0000 x86_64 GNU/Linux
# dmesg | grep linux
[ 0.000000] Linux version 5.17.1-zen1-1-zen (linux-zen@archlinux) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.38) #1 ZEN SMP PREEMPT Mon, 28 Mar 2022 21:56:46 +0000
[ 0.000000] Command line: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=ba36f8b9-ac35-44c2-b5d9-0dfa868fba4a rw rootflags=subvol=@ quiet loglevel=3 nowatchdog nvme_load=YES amd_pstate.shared_mem=1 amd_pstate.enable=1
[ 0.034567] Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=ba36f8b9-ac35-44c2-b5d9-0dfa868fba4a rw rootflags=subvol=@ quiet loglevel=3 nowatchdog nvme_load=YES amd_pstate.shared_mem=1 amd_pstate.enable=1
[ 0.034620] Unknown kernel command line parameters "BOOT_IMAGE=/@/boot/vmlinuz-linux-zen nvme_load=YES", will be passed to user space.
[ 0.560729] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <email@example.com>
[ 3.571384] TERM=linux
[ 3.571384] BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
$ lscpu | grep cppc
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
Edit: Tried a few more things such as:
Enable that second option in BIOS (CPPC Preferred Cores)
Blacklist the module acpi_cpufreq by putting in my cmdline blacklist_module=acpi_cpufreq
Boot with both options amd_pstate.shared_mem=1 and amd_pstate.enable=1 or just the 1st one
But none of these actions worked, so I’ll give up for now…
I tried to blacklist it as according to phoronix link, there is a possibility that acpi_cpufreq gets loaded during boot and amd-pstate doesn’t…
But whatever I do, it doesn’t work for me…
I guess that our amd_pstate module wasn’t enabled during the kernel build as mentioned by moson, not sure because I never compiled a kernel before, I’m pretty noob when it comes to it…
lower idle speed/power and in theory the system has finer frequency control in relation to power/performance but its new and most of the work on it has been in relation to mobile/laptop use and things like the steam deck which Valve helped develop this for.