1

I have a Lenovo T570 with Xubuntu 18.04 LTS. My current issue is that my cpu speed stepping is kind of going nuts and does what ever it thinks its best.

Sample: when I run my IDE and cpu load increases during build time, the governor changes automatically. I caught the moment during compiling my project with the following call:

martin@martin-ThinkPad-T570:~$ while cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; do sleep 1; done
powersave
powersave
performance
performance

cpufreq-info tells me this:

martin@martin-ThinkPad-T570:~$ cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, 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: 400 MHz - 3.50 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.50 GHz and 3.50 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.25 GHz.
analyzing CPU 1:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency: 4294.55 ms.
  hardware limits: 400 MHz - 3.50 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.50 GHz and 3.50 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.36 GHz.
analyzing CPU 2:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency: 4294.55 ms.
  hardware limits: 400 MHz - 3.50 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.50 GHz and 3.50 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.26 GHz.
analyzing CPU 3:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency: 4294.55 ms.
  hardware limits: 400 MHz - 3.50 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.50 GHz and 3.50 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.36 GHz.

Please take a look at

current policy: frequency should be within 3.50 GHz and 3.50 GHz. The governor "performance" may decide which speed to use

Afterwards to go back to powersave I use my little script:

martin@martin-ThinkPad-T570:~$ cat cpu_freq_save.sh 
#!/bin/bash
sudo cpufreq-set -g powersave -c 0 --min 400MHz
sudo cpufreq-set -g powersave -c 1 --min 400MHz
sudo cpufreq-set -g powersave -c 2 --min 400MHz
sudo cpufreq-set -g powersave -c 3 --min 400MHz

Which resets the min frequency and the governor but as soon as I compile again with my IDE every time the governor and the min frequency changes again.

Any idea how I can disable that automatic change?

PS: If you need more details, just tell me where to find them and I will provide them

1
+100

cpufreqd is a frequency management daemon installed with:

sudo apt install cpufreqd

A configuration file cpufreqd.conf is used to change frequencies. There are two sections where you can see it changing governor to "performance":

[Profile]
name=hi_boost
minfreq=0%
maxfreq=100%
policy=performance

# full power when AC
[Rule]
name=AC_on
ac=on                   # (on/off)
profile=hi_boost

It's harder to figure out when it changes to "powersave" unless the battery charger is unplugged.

Since kernel 3.4 cpufreq is built into the kernel and loaded automatically. It includes frequency management daemon called thermald. As such there isn't much a need for cpufreqd anymore and it may have conflicted on your system.

For even greater customization under battery power the tlp package is commonly used these days.

1

I played around with different things and ended up removing cpufreqd from my system and only left cpufrequtils installed and boom it does not switch the governor anymore on load.

1

If your intention is to disable the intel_pstate driver you can do that at boot-time with the kernel arg intel_pstate=disable

This is likely not in your best interests because the intel_pstate driver knows the details of the how the CPU works and it does a better job than the generic ACPI solution. Intel claims that the intel_pstate "powersave" is faster than the generic acpi governor with "performance" likely due to executing some tasks with higher frequency will consume less power than would a lower frequency taking more time e.g. arithmetic stuff, but not true for all tasks e.g. loading something from memory.

The best thing you can do is ignore it and let the intel_pstate driver do it's job, allowing the use of the TurboBoost Technology built into the chip which is adjusting the frequency automatically based on power rating, temperature rating, and current limits

For contemporary Intel processors such as the Core i5 7300U you appear to have (although you don't mention the model), the frequency is controlled by the processor itself and the P-states exposed to software are related to performance levels. The idea that frequency can be set to a single frequency is fiction for Intel Core processors. Even if the scaling driver selects a single P state the actual frequency the processor will run at is selected by the processor itself.

Sources:

https://unix.stackexchange.com/questions/121410/setting-cpu-governor-to-on-demand-or-conservative

https://www.cnet.com/products/lenovo-thinkpad-t570-15-6-core-i5-7300u-8-gb-ram-256-gb-ssd-20h9000uus/

https://en.wikichip.org/wiki/intel/core_i5/i5-7300u

  • If your intention is to disable the intel_pstate driver - no, it was never my intention to disable those drivers. I was just super annoyed that whenever my system was under load, it switched to the performance governor making my battery life close to non existing. Thanks for the details anyway! – WarrenFaith May 13 at 7:41
  • @WarrenFaith I'm glad you found the information useful. Always eager to help! – Elder Geek May 14 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.