Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
zen 2 and acpitool CPU frequency
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tetumetal
n00b
n00b


Joined: 09 Jun 2022
Posts: 15

PostPosted: Fri Sep 16, 2022 8:29 pm    Post subject: zen 2 and acpitool CPU frequency Reply with quote

hi Gentoo people,

I have a mini pc with a ryzen 4800U CPU, and the CPU frequency seems to be all the time at maximum (above 4 GHz).

When I check the current cpu frequency with acpitool, I get this output:
Code:

acpitool -c

  CPU type               : AMD Ryzen 7 4800U with Radeon Graphics
  Min/Max frequency      : 1400/1800 MHz
  Current frequency      : 4141 MHz
  Frequency governor     : schedutil
  Freq. scaling driver   : acpi-cpufreq
  Cache size             : 1400.000 KB
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Bogomips               : 3594.68
  Function Show_CPU_Info : could not read directory /proc/acpi/processor/
  Make sure your kernel has ACPI processor support enabled.


When, I check the same with cpupower, I get this:
Code:

cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.40 GHz - 1.80 GHz
  available frequency steps:  1.80 GHz, 1.70 GHz, 1.40 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.40 GHz and 1.80 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: 1.40 GHz (asserted by call to hardware)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  1800MHz
    Pstate-P1:  1700MHz
    Pstate-P2:  1400MHz


And, when I monitor the power with cpupower, I get this:
Code:

cpupower monitor
WARNING: at least one cpu is offline
    | Mperf              || Idle_Stats
 CPU| C0   | Cx   | Freq  || POLL | C1   | C2   | C3
   0|  1.37| 98.63|  4132||  0.00|  1.01|  0.00| 97.78
   2|  1.48| 98.52|  4133||  0.00|  0.98|  0.02| 97.74
   4|  0.52| 99.48|  4148||  0.00|  0.96|  0.00| 98.60
   6|  0.82| 99.18|  4132||  0.00|  0.41|  0.00| 98.89
   8|  0.23| 99.77|  4135||  0.00|  0.00|  0.15| 99.67
  10|  0.48| 99.52|  4143||  0.00|  0.00|  0.25| 99.37
  12|  0.01| 99.99|  4165||  0.00|  0.00|  0.00| 99.99
  14|  0.74| 99.26|  4144||  0.02|  3.81|  0.25| 95.31


Another funny behavior that I observed is that when I start up the computer, the frequency is ~1.8 GHz. But, if there's something that triggers the frequency increase (like extra cpu load), the frequency will stay high (say ~4 GHz) forever after next reboot. This happens regardless if the average load goes back to ~0% for several tens of minutes.

Honestly, I don't believe that the CPU is all the timing running at ~4 GHz, since I montior a Tctl of 66C, which is rather low.

Is this CPU freq. of ~4 GHz correct? Or is acpitool misreading it?

Thanks!
Back to top
View user's profile Send private message
tetumetal
n00b
n00b


Joined: 09 Jun 2022
Posts: 15

PostPosted: Mon Sep 19, 2022 11:51 am    Post subject: Re: zen 2 and acpitool CPU frequency Reply with quote

I found the problem: basically, the cpu boost is active from boot and the linux kernel does not automatically control its activation. Therefore, after booting, the cpu is running at a very high clock speed regardless of the cpu load, which is pretty bad. Also, I could not find any user space application that can automatically control the boost activation.

So, I wrote a simple script to manually enable/disable the frequency boost, which effectively writes the file:
Code:

/sys/devices/system/cpu/cpufreq/boost
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum