You are not logged in.

#1 2022-03-21 19:37:08

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

using the amd-pstate driver in kernel 5.17

I built 5.17.0 enabling CONFIG_X86_AMD_PSTATE=y and taking the kernel defaults from `make olddefconfig` against the official Arch kernel config (currently 5.16.15).  When I boot my Zen3 system into the new kernel, it does not appear to be running the new amd-pstate driver:

% cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
acpi-cpufreq

Yet in dmesg:

% dmesg|grep -i pstate
[  +0.000015] amd_pstate: This processor supports shared memory solution, you can enable it with amd_pstate.shared_mem=1

Anyone using this new driver?  What am I doing wrong?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2022-03-21 20:05:51

loqs
Member
Registered: 2014-03-06
Posts: 18,055

Re: using the amd-pstate driver in kernel 5.17

Did you set the module parameter amd_pstate.shared_mem=1 ?  Needed as shared memory systems have issues see top of same file
https://github.com/torvalds/linux/blob/ … ate.c#L614

Last edited by loqs (2022-03-21 21:55:02)

Offline

#3 2022-03-21 20:23:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

I did not after reading this

docs wrote:

shared_mem Use a module param (shared_mem) to enable related processors manually with amd_pstate.shared_mem=1. Due to the performance issue on the processors with Shared Memory Support, so we disable it for the moment and will enable this by default once we address performance issue on this solution.

I thought amd-pstate would just function without that option... I am wondering about the "performance issue" mentioned and the fact that is not currently addressed.

In any case, adding that to my kernel line indeed enables it:

% cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate

Last edited by graysky (2022-03-21 20:29:42)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2022-03-21 21:49:31

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

amd-pstate =  too much hype for no real gains at this moment.


Excuse my poor English.

Offline

#5 2022-03-21 23:54:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

From what I've read performance is on par with acpi-cpufreq but with lower power consumption.  All depends on how you define gains.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2022-03-22 11:53:21

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

From what I've read performance is on par with acpi-cpufreq but with lower power consumption.  All depends on how you define gains.

Yeah that's the theory, but not on zen2 or zen 3 desktop CPU's for now,  as you have read in the kernel documents.


Excuse my poor English.

Offline

#7 2022-03-22 11:58:25

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

Not totally accurate, just boot with amd_pstate.shared_mem=1 in your kernel line to enable it.  Works on my zen3 chip.  I have not run any benchmarks on performance or power consumption.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2022-03-22 16:33:33

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

Not totally accurate, just boot with amd_pstate.shared_mem=1 in your kernel line to enable it.  Works on my zen3 chip.  I have not run any benchmarks on performance or power consumption.

I know it works, i've been using it since first 5.17 rc. What I meant to say is that for users who have to activate it with that parameter, among which I include myself, there is no gain, on the contrary, in my case I have experienced stuttering while playing. For this reason it is not enabled by default for current desktop CPUs.


Excuse my poor English.

Offline

#9 2022-03-22 21:13:39

loqs
Member
Registered: 2014-03-06
Posts: 18,055

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

I have not run any benchmarks on performance or power consumption.

Benchmark and wattmeter results would be interesting.

Offline

#10 2022-03-22 22:19:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

Benchmarks would be interesting... maybe over the weekend.  I do not have a very good watt meter.  It is an old Kill-A-Watt which reads consumption at the wall (entire system) and does so with whole numbers for watts.  I doubt I would see much of a difference but you don't know until you try.

I am still trying to understand upstream's comment:

docs wrote:

shared_mem Use a module param (shared_mem) to enable related processors manually with amd_pstate.shared_mem=1. Due to the performance issue on the processors with Shared Memory Support, so we disable it for the moment and will enable this by default once we address performance issue on this solution.

As agapito mentioned, that reads to me like "you have to force amd-pstate to work by using amd_pstate.shared_mem=1 but we disabled it until we can fix a known performance issue."


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2022-03-22 22:24:01

progandy
Member
Registered: 2012-05-17
Posts: 5,263

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

As agapito mentioned, that reads to me like "you have to force amd-pstate to work by using amd_pstate.shared_mem=1 but we disabled it until we can fix a known performance issue."

The commit has some more context: https://git.kernel.org/pub/scm/linux/ke … e92f0d55b5
and the doc: https://www.kernel.org/doc/html/latest/ … ry-support

Last edited by progandy (2022-03-22 22:30:43)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#12 2022-03-22 23:39:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

Thanks for sharing the commit, it does indeed.  Take home to me not ready for prime time on these CPUs yet.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2022-04-17 07:57:26

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

does anybody get amd-pstate to run on a desktop cpu?
I have troube with activating. I have a 5800X, on a Asrock B550 mainboard.

with the kernel parameter initcall_blacklist=acpi_cpufreq_init amd_pstate.enable=1 it does not run on my machine sad

Offline

#14 2022-04-17 08:55:45

mrlamud
Member
Registered: 2014-09-27
Posts: 105

Re: using the amd-pstate driver in kernel 5.17

1.Do you enable cppc in Bios?
2.What is the output from this command :

 lscpu | grep cppc

Mine's R3 4300GE + MSI B450 (lates beta bios)  , amd-pstate is in used once install kernel 5.17 without adding those parameters.

# cpupower frequency-info

analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 4.11 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 400 MHz and 4.11 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 2.84 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3500MHz
    Pstate-P1:  1700MHz
    Pstate-P2:  1400MHz
cat /boot/loader/entries/c.conf
title	Linux - kx 
linux	/vmlinuz-linux-kx
initrd	/amd-ucode.img
initrd	/initramfs-linux-kx.img
options	root=PARTUUID=3e354a2e-497f-49b9-8e38-7cedbbcf7964 rw amd_iommu=on iommu=pt usbhid.mousepoll=4 amdgpu.freesync_video=1

Offline

#15 2022-04-17 09:37:30

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

I found two CPPC entries in my Asrock Uefi/Bios. I can enable one, the second or both. No changes in the outputs.
I have a Asrock B550M Steel Legend, with the newest Bios 2.30 from manufacturer, which includes AMD AM4 AGESA Combo V2 PI 1.2.0.6b.

My kernel is

 > uname -r
5.17.3-arch1-1

Its the official arch kernel. I think my kernel was compiled with amd-pstate as module:

> cat /usr/lib/modules/5.17.3-arch1-1/build/.config  | grep  CONFIG_X86_AMD_PSTATE=m
CONFIG_X86_AMD_PSTATE=m

..or..

> zcat /proc/config.gz | grep CONFIG_X86_AMD_PSTATE
CONFIG_X86_AMD_PSTATE=m

I have also a modinfo entry.

> modinfo amd_pstate
filename:       /lib/modules/5.17.3-arch1-1/kernel/drivers/cpufreq/amd_pstate.ko.zst
license:        GPL
description:    AMD Processor P-state Frequency Driver
author:         Huang Rui <ray.huang@amd.com>
srcversion:     F7863F96571AF359A207E8B
depends:        
retpoline:      Y
intree:         Y
name:           amd_pstate
vermagic:       5.17.3-arch1-1 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        5F:1A:C0:54:F0:99:9E:16:63:82:F4:93:CE:06:5A:10:4A:2B:27:6A
sig_hashalgo:   sha512
signature:      30:65:02:30:0F:DA:A8:99:4E:65:3A:4F:A4:47:24:58:FF:13:D9:28:
		28:7D:19:CD:54:9B:83:27:52:E3:A8:D8:9C:D9:BF:B4:ED:A5:BF:B7:
		0E:F9:4D:6A:83:82:78:C4:5A:54:C4:CF:02:31:00:C9:AF:E2:ED:01:
		CF:0A:F3:2D:21:1F:B7:F1:23:65:91:2E:D4:7D:7B:0B:AF:C5:31:3A:
		52:06:ED:A4:00:94:49:06:C6:F7:E2:CE:8F:F4:7E:D3:F4:C9:DB:69:
		AC:8B:98
parm:           shared_mem:enable amd-pstate on processors with shared memory solution (false = disabled (default), true = enabled) (bool)

My output of lscpu:

> lscpu 
Architektur:                       x86_64
  CPU Operationsmodus:             32-bit, 64-bit
  Adressgrößen:                    48 bits physical, 48 bits virtual
  Byte-Reihenfolge:                Little Endian
CPU(s):                            16
  Liste der Online-CPU(s):         0-15
Anbieterkennung:                   AuthenticAMD
  BIOS-Anbieterkennung:            Advanced Micro Devices, Inc.
  Modellname:                      AMD Ryzen 7 5800X 8-Core Processor
    BIOS-Modellname:               AMD Ryzen 7 5800X 8-Core Processor              Unknown CPU @ 3.8
                                   GHz
    BIOS-Prozessorfamilie:         107
    Prozessorfamilie:              25
    Modell:                        33
    Thread(s) pro Kern:            2
    Kern(e) pro Sockel:            8
    Sockel:                        1
    Stepping:                      0
    Übertaktung:                   aktiviert
    Skalierung der CPU(s):         63%
    Maximale Taktfrequenz der CPU: 4850,1948
    Minimale Taktfrequenz der CPU: 2200,0000
    BogoMIPS:                      7588.02
    Markierungen:                  fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat
                                    pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pd
                                   pe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd
                                   _apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4
                                   _1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm c
                                   mp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefe
                                   tch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext
                                    perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibp
                                   b stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rd
                                   seed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsav
                                   es cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irper
                                   f xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_
                                   scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshol
                                   d avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclm
                                   ulqdq rdpid overflow_recov succor smca
Virtualisierungsfunktionen:        
  Virtualisierung:                 AMD-V
Caches (Gesamtsumme):              
  L1d:                             256 KiB (8 Instanzen)
  L1i:                             256 KiB (8 Instanzen)
  L2:                              4 MiB (8 Instanzen)
  L3:                              32 MiB (1 Instanz)
NUMA:                              
  NUMA-Knoten:                     1
  NUMA-Knoten0 CPU(s):             0-15
Schwachstellen:                    
  Itlb multihit:                   Not affected
  L1tf:                            Not affected
  Mds:                             Not affected
  Meltdown:                        Not affected
  Spec store bypass:               Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:                      Mitigation; usercopy/swapgs barriers and __user pointer sanitizat
                                   ion
  Spectre v2:                      Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-o
                                   n, RSB filling
  Srbds:                           Not affected
  Tsx async abort:                 Not affected

My cpupower frequency-info, when I do not disable acpi.

> cpupower frequency-info
CPU 0 wird analysiert:
  driver: acpi-cpufreq
  CPUs, die mit der gleichen Hardwarefrequenz laufen: 0
  CPUs, die ihre Frequenz mit Software koordinieren müssen: 0
  Maximale Dauer eines Taktfrequenzwechsels:  Cannot determine or is not supported.
  Hardwarebegrenzungen: 2.20 GHz - 4.85 GHz
  available frequency steps:  3.80 GHz, 2.80 GHz, 2.20 GHz
  verfügbare cpufreq-Regler: conservative ondemand userspace powersave performance schedutil
  momentane Richtlinie: Frequenz sollte innerhalb 2.20 GHz und 3.80 GHz.
                    sein. Der Regler "schedutil" kann frei entscheiden,
                    welche Geschwindigkeit er in diesem Bereich verwendet.
  current CPU frequency: 3.80 GHz (asserted by call to hardware)
  boost state support:
    Unterstützt: ja
    Aktiv: ja
    Boost-Zustände: 0
    Gesamtzustände: 3
    Pstate-P0:  3800MHz
    Pstate-P1:  2800MHz
    Pstate-P2:  2200MHz

I use grub. To deactivate acpi I modify in /etc/default/grub my command line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 initcall_blacklist=acpi_cpufreq_init amd_pstate.enable=1"

Then I get after rebooting I get with cpupower frequency-info:

> cpupower frequency-info
CPU 0 wird analysiert:
  kein oder ein unbekannter cpufreq-Treiber ist auf dieser CPU aktiv
  CPUs, die mit der gleichen Hardwarefrequenz laufen: Not Available
  CPUs, die ihre Frequenz mit Software koordinieren müssen: Not Available
  Maximale Dauer eines Taktfrequenzwechsels:  Cannot determine or is not supported.
Not Available
  verfügbare cpufreq-Regler: Not Available
  Unable to determine current policy
  current CPU frequency: Unable to call hardware
  current CPU frequency:  Unable to call to kernel
  boost state support:
    Unterstützt: ja
    Aktiv: ja
    Boost-Zustände: 0
    Gesamtzustände: 3
    Pstate-P0:  3800MHz
    Pstate-P1:  2800MHz
    Pstate-P2:  2200MHz

And with every boot, also when I try to load the module manually I get:

> modprobe amd-pstate
modprobe: ERROR: could not insert 'amd_pstate': No such device

Looks like the Desktop 5800X doesn't support it. But I cannot imagine, that the Zen3 is not supported.
(sorry for some german words in the outputs, I'm from germany)

Offline

#16 2022-04-17 09:55:10

moson
Member
Registered: 2021-06-03
Posts: 10
Website

Re: using the amd-pstate driver in kernel 5.17

Try to load the module like this:

sudo modprobe amd_pstate dyndbg==pmf -v

Then check the dmesg output. Should have some more verbose output why it failed to load...

Offline

#17 2022-04-17 10:13:49

mrlamud
Member
Registered: 2014-09-27
Posts: 105

Re: using the amd-pstate driver in kernel 5.17

Your cpu info doesn't show "cppc" flags like mine:-

$lscpu | grep "cppc"
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext 
fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 
sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch 
osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall 
fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc 
cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd ##cppc## arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid 
decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca

And as of  amd-pstate introduction https://git.kernel.org/pub/scm/linux/ke … ate-dev-v5

....
+If CPU Flags have cppc, then this processor supports `Full MSR Support
+<perf_cap_>`_. Otherwise it supports `Shared Memory Support <perf_cap_>`_.
....
.......
+Processor Support
+=======================
+
+The ``amd-pstate`` initialization will fail if the _CPC in ACPI SBIOS is
+not existed at the detected processor, and it uses ``acpi_cpc_valid`` to
+check the _CPC existence. All Zen based processors support legacy ACPI
+hardware P-States function, so while the ``amd-pstate`` fails to be
+initialized, the kernel will fall back to initialize ``acpi-cpufreq``
+driver.
+
+There are two types of hardware implementations for ``amd-pstate``: one is
+`Full MSR Support <perf_cap_>`_ and another is `Shared Memory Support
+<perf_cap_>`_. It can use :c:macro:`X86_FEATURE_CPPC` feature flag (for
+details refer to Processor Programming Reference (PPR) for AMD Family
+19h Model 51h, Revision A1 Processors [3]_) to indicate the different
+types. ``amd-pstate`` is to register different ``static_call`` instances
+for different hardware implementations.
+
+Currently, some of Zen2 and Zen3 processors support ``amd-pstate``. In the
+future, it will be supported on more and more AMD processors.
+
+Full MSR Support
+-----------------
+
+Some new Zen3 processors such as Cezanne provide the MSR registers directly
+while the :c:macro:`X86_FEATURE_CPPC` CPU feature flag is set.
+``amd-pstate`` can handle the MSR register to implement the fast switch
+function in ``CPUFreq`` that can shrink latency of frequency control on the
+interrupt context. The functions with ``pstate_xxx`` prefix represent the
+operations of MSR registers.
+
+Shared Memory Support
+----------------------
+
+If :c:macro:`X86_FEATURE_CPPC` CPU feature flag is not set, that means the
+processor supports shared memory solution. In this case, ``amd-pstate``
+uses the ``cppc_acpi`` helper methods to implement the callback functions
+that defined on ``static_call``. The functions with ``cppc_xxx`` prefix
+represent the operations of acpi cppc helpers for shared memory solution.
+
+
+AMD P-States and ACPI hardware P-States always can be supported in one
+processor. But AMD P-States has the higher priority and if it is enabled
+with :c:macro:`MSR_AMD_CPPC_ENABLE` or ``cppc_set_enable``, it will respond
+to the request from AMD P-States.
+
.......

Continue from above , this is the fun part you might pay attention and try it.

.....
+``amd-pstate`` vs ``acpi-cpufreq``
+======================================
+
+On majority of AMD platforms supported by ``acpi-cpufreq``, the ACPI tables
+provided by the platform firmware used for CPU performance scaling, but
+only provides 3 P-states on AMD processors.
+However, on modern AMD APU and CPU series, it provides the collaborative
+processor performance control according to ACPI protocol and customize this
+for AMD platforms. That is fine-grain and continuous frequency range
+instead of the legacy hardware P-states. ``amd-pstate`` is the kernel
+module which supports the new AMD P-States mechanism on most of future AMD
+platforms. The AMD P-States mechanism will be the more performance and energy
+efficiency frequency management method on AMD processors.
+
+Kernel Module Options for ``amd-pstate``
+=========================================
+
+``shared_mem``
+Use a module param (shared_mem) to enable related processors manually with
+**amd_pstate.shared_mem=1**.
+Due to the performance issue on the processors with `Shared Memory Support
+<perf_cap_>`_, so we disable it for the moment and will enable this by default
+once we address performance issue on this solution.
+
+The way to check whether current processor is `Full MSR Support <perf_cap_>`_
+or `Shared Memory Support <perf_cap_>`_ : ::
+
+  ray@hr-test1:~$ lscpu | grep cppc
+  Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
+
+If CPU Flags have cppc, then this processor supports `Full MSR Support
+<perf_cap_>`_. Otherwise it supports `Shared Memory Support <perf_cap_>`_.
+
.....

Offline

#18 2022-04-17 11:35:30

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

Many Thanksfor the link. This was new for me that there are two implementations for CPPC. Now I got amd-pstate running, see:

cpupower frequency-info
CPU 0 wird analysiert:
  driver: amd-pstate
  CPUs, die mit der gleichen Hardwarefrequenz laufen: 0
  CPUs, die ihre Frequenz mit Software koordinieren müssen: 0
  Maximale Dauer eines Taktfrequenzwechsels: 131 us
  Hardwarebegrenzungen: 550 MHz - 4.85 GHz
  verfügbare cpufreq-Regler: conservative ondemand userspace powersave performance schedutil
  momentane Richtlinie: Frequenz sollte innerhalb 550 MHz und 4.85 GHz.
                    sein. Der Regler "schedutil" kann frei entscheiden,
                    welche Geschwindigkeit er in diesem Bereich verwendet.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.01 GHz (asserted by call to kernel)
  boost state support:
    Unterstützt: ja
    Aktiv: ja
    Boost-Zustände: 0
    Gesamtzustände: 3
    Pstate-P0:  3800MHz
    Pstate-P1:  2800MHz
    Pstate-P2:  2200MHz

I had the whole time the false parameter/entry in my grub command line. With the first four lines it doesn't work. The last line is now working:

#GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 modprobe.blacklist=acpi-cpufreq"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 initcall_blacklist=acpi_cpufreq_init"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 amd_pstate.enable=1"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 initcall_blacklist=acpi_cpufreq_init amd_pstate.enable=1"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=2 amd_pstate.shared_mem=1"

So, the correct parameter is for my 5800X: amd_pstate.shared_mem=1
Now my CPU has in idle state 550MHz. Great, many thanks smile

Offline

#19 2022-04-17 11:45:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: using the amd-pstate driver in kernel 5.17

But...

progandy wrote:
graysky wrote:

As agapito mentioned, that reads to me like "you have to force amd-pstate to work by using amd_pstate.shared_mem=1 but we disabled it until we can fix a known performance issue."

The commit has some more context: https://git.kernel.org/pub/scm/linux/ke … e92f0d55b5
and the doc: https://www.kernel.org/doc/html/latest/ … ry-support

So if you're forcing it, performance is likely not optimal.

graysky wrote:

Thanks for sharing the commit, it does indeed.  Take home to me not ready for prime time on these CPUs yet.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#20 2022-04-17 12:37:36

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

Yep... I should just read more carefully...

Offline

#21 2022-06-17 04:22:20

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

Hi guys,
I have enabled amd_pstate but now my processor idles at 2500mhz, changing the governor doesn't make a difference

Previously on acpi-cpufreq it would idle around 1100-1300mhz

How can I set limits so that on battery the processor idles lower? I am only assuming that 2500mhz idle will ultimately use more power over time

There is meant to be a desired performance level but I cant see where to change this setting e.g. not an option in /sys/devices/system/cpu/cpufreq/policy0/

Offline

#22 2022-06-17 07:28:04

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

sounds like an laptop.
what ist your output of

lscpu | grep "cppc"

and

dmesg

what you ave tried already?

Offline

#23 2022-06-19 11:27:39

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

obelisk wrote:

sounds like an laptop.
what ist your output of

lscpu | grep "cppc"

and

dmesg

what you ave tried already?

cppc appears and I can see the driver is working, I am just puzzled why the CPU does't wind down to 400mhz when idle.. 2500mhz seems to be the lowest it goes

In dmesg I cannot see anything for pstate or other hints that could indicate a problem.

I have tried a few different governors etc, I haven't tried lowering the max scale frequency because that will also impact performance on AC, from reading what I can change, can't find a setting around average/idle speed

Offline

#24 2022-08-03 12:23:44

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 8#p2062998

Last edited by agapito (2023-02-01 12:18:28)


Excuse my poor English.

Offline

#25 2022-08-03 23:36:38

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

agapito wrote:

I compiled kernel 5.19 myself and in the last 48 hours I've been using amd-pstate instead acpi-cpufreq. It is not yet the default option so "amd_pstate.shared_mem=1" is still needed. It seems that the performance issues have been fixed or at least I haven't encountered

Good to hear, I found out that it's working properly on my system (5.18 kernel still) except when using schedutil which doesn't go lower than 2500mhz, all the other governors obey the ranges either preset or set by me. I saw a bug report open which I believe relates to the issue so assume it will get resolved in a later kernel.

I haven't done any formal testing but it seems that using conservative for example, the battery will last longer overall.

Offline

Board footer

Powered by FluxBB