I have set the frequencies of the 4 cores of my Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
CPU to lower values (800Mhz
) for energy saving when using the computer on the field using this command:
for i in {0..3}; do sudo cpufreq-set -c ${i} -g powersave --min 500Mhz --max 800Mhz; done
and it worked the first time I ran it, as shown by watch -n2 'cat /proc/cpuinfo | grep -i "mhz"'
:
Every 20.0s: cat /proc/cpuinfo | grep -i "mhz"
Mon Oct 19 06:15:37 2020
cpu MHz : 798.686
cpu MHz : 798.694
cpu MHz : 799.514
cpu MHz : 798.860
After a while, I closed the lid, and the laptop (Lenovo T440s / Ubuntu 16.04 4.15.0-120-generic x86_64 GNU/Linux
+ another one where the same issue appears on Ubuntu 18.04 5.4.0-48-generic x86_64 GNU/Linux
) went to sleep as usual.
I took it back a few hours later, and the command doesn't seem to be effective anymore, so I ran it again, but the watch process always shows higher-than-allowed frequencies now:
Every 20.0s: cat /proc/cpuinfo | grep -i "mhz"
Mon Oct 19 12:18:39 2020
cpu MHz : 2341.501
cpu MHz : 2261.700
cpu MHz : 2249.787
cpu MHz : 2117.165
There isn't actually much than 1-2% CPU load at that time.
I also checked $ sudo cpufreq-info
which shows the same high frequencies, which is strange because they are out of the allowed range for the powersave governor I set using the above command:
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 4294.55 ms.
hardware limits: 800 MHz - 3.30 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 800 MHz and 800 MHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 2.11 GHz.
(all the 4 cores show the same)
A same kind of output is shown by $ sudo cpupower frequency-info
:
analyzing CPU 0:
driver: intel_pstate
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: 800 MHz - 3.30 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 800 MHz and 800 MHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 2.25 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Both these commands show basically the same than this which parse some cpu files:
$ cd /sys/devices/system/cpu/cpu0/cpufreq && paste <(ls *) <(cat *)
affected_cpus 0
cpuinfo_max_freq 3300000
cpuinfo_min_freq 800000
cpuinfo_transition_latency 0
related_cpus 0
scaling_available_governors performance powersave
scaling_cur_freq 2241317
scaling_driver intel_pstate
scaling_governor powersave
scaling_max_freq 800000
scaling_min_freq 800000
scaling_setspeed <unsupported>
Question
How could I fix it (i.e. make it work across entering/exiting suspend/sleep modes)?
Edits:
Information about intel pstates:
$ cd /sys/devices/system/cpu/intel_pstate/ && paste <(ls *) <(cat *)
max_perf_pct 30
min_perf_pct 15
no_turbo 1
num_pstates 28
status active
turbo_pct 25
0 Answers