dietpi-config only has CPU Governor "performance" and "powersave" Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
User avatar
zhage
Posts: 4
Joined: Sat Nov 02, 2019 11:51 pm

dietpi-config only has CPU Governor "performance" and "powersave"

Post by zhage »

Hello there!

I installed dietpi no a x86_64 Machine and wanted to change CPU Governor to conservative or ondemand to lower the power consumption and heat dissipation.

In dietpi-config there are only "performance" and "powersave" as options to choose from.

Before I go and change some textfiles to change the CPU Governor I just wanted to ask if there is any reason why there are no options like "ondemand" and "conservative" in the dietpi-config tool.

And what would be the best way to set up a CPU Governor "conservative" in dietpi?!


Thank you very much for your help and suggestions.
Greetings! :)
User avatar
MichaIng
Site Admin
Posts: 2987
Joined: Sat Nov 18, 2017 6:21 pm

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by MichaIng »

DietPi-Config shows you all governors which are available on your system. Please verify via:

Code: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
Or do you have multiple CPU types with different available governors?

Code: Select all

cat /sys/devices/system/cpu/cpufreq/policy1/scaling_available_governors
mail2rst
Posts: 110
Joined: Fri Apr 13, 2018 4:53 pm

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by mail2rst »

I also counter check my intel nuc & only "PERFORMANCE" AND "POWERSAVE" available in dietpi-config. provided commands also shown only these two options available.

Code: Select all

root@DietPi:~# cat /sys/devices/system/cpu/cpufreq/policy1/scaling_available_governors
performance powersave
root@DietPi:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
performance powersave
root@DietPi:~#
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by Joulinar »

looks like your CPU doesn't support other mods
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
mail2rst
Posts: 110
Joined: Fri Apr 13, 2018 4:53 pm

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by mail2rst »

this time my system works on "performance mode". Do you recommend to change it to "powersave mode" . as in one forum it is written intel powersave mode similar to on demand. please give your expert suggestion. my nuc only running adguard, unbound, plex & wireguard via docker compose. & 99% of daytime cpu load less then 1%. CPU command shows this thing

Code: Select all

root@DietPi:/mnt/dietpi_userdata# cpu

 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     x86_64
 Temperature  |     39'C : 102'F (Cool runnings)
 Governor     |     performance

                 Current Freq    Min Freq   Max Freq
 CPU0         |      1344 MHz      1332 MHz    2415 MHz
 CPU1         |      1414 MHz      1332 MHz    2415 MHz
 CPU2         |      1599 MHz      1332 MHz    2415 MHz
 CPU3         |      1333 MHz      1332 MHz    2415 MHz

[ INFO ] DietPi-CPU_info | CPU current frequency, may be affected by this script, due to the processing required to run it.
User avatar
zhage
Posts: 4
Joined: Sat Nov 02, 2019 11:51 pm

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by zhage »

Thank you for your help and answers/questions.

The x86_64 Box in question is a Dell Wyse 5070 with a Intel Celeron™ J4105 Processor.

All C-States are also enabled in BIOS.


Following some outputs:

Code: Select all

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
performance powersave

Code: Select all

# cat /sys/devices/system/cpu/cpufreq/policy1/scaling_available_governors
performance powersave

Code: Select all

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance

Code: Select all

# cpu

 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     x86_64
 Temperature  |     35'C : 95'F (Cool runnings)
 Governor     |     performance

                 Current Freq    Min Freq   Max Freq
 CPU0         |      1773 MHz      800 MHz    2500 MHz
 CPU1         |      1758 MHz      800 MHz    2500 MHz
 CPU2         |      819 MHz      800 MHz    2500 MHz
 CPU3         |      683 MHz      800 MHz    2500 MHz

So, the last days I didn't have much time to get deeper into resolving this issue but it seems that Intel is using a different/new Power Scaling Driver (intel_pstate) as of Codename Sandy Bridge and newer CPUs.
The old acpi_cpufreq CPU Scaling Driver was used up to Codename Nehalem/Westmere CPUs.

With the newer scaling driver performance and powersave are the only CPU Scaling Governors available. So the governors ondemand and conservative (which I was used to) are not available anymore with these new drivers.

So I monitored the CPU frequency (with "watch cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq") over some time and saw that the cores are scaling between 700MHz and 2500Mhz. The CPU Governor of this Dell ThinClient was set to performance so I thought that the CPU would clock to max_cpufreq 2500MHz constantly. Then I read (Here in the ArchWiki) that the behavior of performance of the old acpi_cpufreq compared to the identically named governor of the new intel_pstate Power Scaling Drivers is different.

Here a small excerpt of the ArchWiki:
Note: The intel_pstate driver supports only two governors: powersave and performance. Although they share the name with the generic governors, they do not work in the same way as the generic governors. Both intel_pstate governors provide dynamic scaling similar to the schedutil or ondemand generic governors. The performance governor provided by intel_pstate should give better power saving functionality than the old ondemand governor.
Sorry for the unnecessary long post. So following the TLDR:

So in conclusion
  • The newer intel_pstate Power Scaling driver which is used by default on CPUs starting from Intel Sandy Bridge only provides CPU Scaling Governors powersave and performance.
  • The CPU Governor named performance of the old acpi_cpufreq behaves differently compared to the identically named CPU Governor of the newer intel_pstate Power Scaling Driver.
  • The CPU Governor performance of the newer intel_pstate Driver behaves similar to the ondemand CPU Governor of the old acpi_cpufreq driver. It even should give better powersaving functionality compared to the old ondemand CPU Governor.
So leave it at performance or if you need to clock the Cores to the min frequency then use powersave.
If you want to cap the Frequency at a custom max clock then you can change the max Frequency of the performance governor with dietpi-config.


I didn't read all the information I was browsing throgh in every detail and didn't want to go into that rabbit hole.
I know myself: Once you "clock" you can't stop. ;-) So YMMV.

Sources:

Code: Select all

https://wiki.archlinux.org/title/CPU_frequency_scaling#CPU_frequency_driver
https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html
https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/power_management_guide/cpufreq_governors
https://www.reddit.com/r/archlinux/comments/9z4ekp/whats_the_point_of_scaling_governors_with_intel/
https://www.reddit.com/r/Fedora/comments/fvgo4g/power_saving_governors_intel_pstate_down_that/
User avatar
MichaIng
Site Admin
Posts: 2987
Joined: Sat Nov 18, 2017 6:21 pm

Re: dietpi-config only has CPU Governor "performance" and "powersave"

Post by MichaIng »

The Intel pstates scaling driver is actually not better but worse than the Linux native CPUfreq (average power usage vs responsiveness), from all I read about it. But I guess it also depends on Linux version and Intel CPU/chip.

But it makes sense that we detect and correctly handle the Intel driver, hence do not show and try to apply CPUfreq governor settings in this case. Can you please page the output of:

Code: Select all

for i in /sys/devices/system/cpu/intel_pstate/*; do echo "$i: $(<$i)"; done
I have an old Intel notebook here to compare with, and and Ivy Bridge as well, so we should be able to see the different shades.

Also nice would be the option to switch between Intel driver and CPUfreq. Can you show the loaded modules?

Code: Select all

lsmod
FYI: https://github.com/MichaIng/DietPi/issues/4489
Post Reply