You are not logged in.

#1 2018-05-11 11:16:23

dgs
Member
Registered: 2018-05-11
Posts: 15

CPU Frequency always at minimum, except when resume after suspend

Hello all,

I am having issues with my cpu constantly being at the lowest frequency, except after I resume the system from suspend, like when opening the lid and even then it's about a couple of minutes before the CPU goes back down to the minimum of 400MHz. Even after rebooting the frequency is always down at minimum.

I am using:

watch grep "cpu MHz" /proc/cpuinfo' 

to monitor the cpu frequency and the output is always 1 or 2 over the minimum of 400MHz. I have tried using cpupower to set the governor to performance, ondemand and powersave and neither made a difference. I also ensured the changes were being placed correctly by running:

 grep . /sys/devices/system/cpu/cpu0/cpufreq/* 

. The output of this was the following:

 /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/bios_limit:2100000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq:2100000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:2401000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:400000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency:10000
/sys/devices/system/cpu/cpu0/cpufreq/freqdomain_cpus:0 1 2 3
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies:2401000 2400000 2300000 2100000 2000000 1800000 1700000 1500000 1400000 1300000 1100000 1000000 800000 700000 500000 400000 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors:powersave ondemand performance schedutil 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:400007
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:acpi-cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:ondemand
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:2100000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:400000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed:<unsupported>
grep: /sys/devices/system/cpu/cpu0/cpufreq/stats: Is a directory

The output for this is the same for all CPUs. I have tried disabling intel_pstate on the grub config file. Did not make a difference and I suspect it's related to the driver being acpi-cpufreq driver as shown above and not the intel_pstate driver. This however, only changed recently after I disabled intel_pstate in the grub cfg. The output of the above was intel_pstate as the driver prior to that.

I do not have any power saving tools, such as laptop-mode-tools other than thermald but I've already disabled it through systemctl and made no difference.

My CPU is the i5-6200U and running Arch Linux 4.16.3 on KDE.

Any ideas?
I've searched everywhere but can't find any possible solution.
Thanks in advance, all help truly appreciated.

Offline

#2 2018-05-11 11:40:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: CPU Frequency always at minimum, except when resume after suspend

Don't disable p-state for no reason, it tends to work better.

/proc/cpuinfo isn't a good source to check, in fact synchronisation of the frequency has been entirely removed for a while in the 4.13 series, but AFAIK it has been reenabled, but is still only a approximation compared to properly tailored utilities.

Use cpupower/turbostat/i7z to monitor actual frequencies.

And the most important question of all, why exactly do you think this has to be different/something is wrong? The notion of a CPU being on a single frequency (whether max perf or not) is bogus anyway, and modern intel CPUs will properly ramp up or down depending on load, are you actually running something you'd expect to produce load and don't see any of the cores going up/your tasks being slower?

And FWIW is your microcode up to date? You might want to make sure that it is.

Offline

#3 2018-05-11 11:46:01

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: CPU Frequency always at minimum, except when resume after suspend

What happens if you stress your cpu, by running cpuburn for each core for example?

performance governor should run the cpu with maximum frequency when using acpi-cpufreq driver.
With intel_pstate frequency will be dynamically scaled regardless of the governor being used.

Offline

#4 2018-05-11 11:52:38

dgs
Member
Registered: 2018-05-11
Posts: 15

Re: CPU Frequency always at minimum, except when resume after suspend

V1del wrote:

Don't disable p-state for no reason, it tends to work better.

/proc/cpuinfo isn't a good source to check, in fact synchronisation of the frequency has been entirely removed for a while in the 4.13 series, but AFAIK it has been reenabled, but is still only a approximation compared to properly tailored utilities.

Use cpupower/turbostat/i7z to monitor actual frequencies.

And the most important question of all, why exactly do you think this has to be different/something is wrong? The notion of a CPU being on a single frequency (whether max perf or not) is bogus anyway, and modern intel CPUs will properly ramp up or down depending on load, are you actually running something you'd expect to produce load and don't see any of the cores going up/your tasks being slower?

And FWIW is your microcode up to date? You might want to make sure that it is.

Thank you for your prompt response and the advice. I will use the tools you mentioned to monitor the frequencies, although cpupower -monitor does deliver the same output as proc. I will also remove the intel_pstate line off of my grub cfg.
And to answer your question as to why do I think that something should be different is because upon resuming from suspend, I am able to open things in a very fast manner, like editors such as Atom/Brackets and IDEs such as NetBeans and Arduino IDE, where as they would otherwise lag and take much longer to open. Even for FireFox, opening up new tabs is surprisingly slow, where as when I open them after resuming suspend, they open really fast. Which is why I suspect something is not quite right with the frequencies and not a coincidence with the lags occurring. I suppose I should have mentioned that before. Also, my microcode is up to date. I have doubled checked based on the Arch Wiki.
Any other ideas?  Thanks again!

Offline

#5 2018-05-11 11:56:12

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: CPU Frequency always at minimum, except when resume after suspend

One possibility is, that your cpu frequency is ramped down because your system is overheating.

Offline

#6 2018-05-11 12:04:21

dgs
Member
Registered: 2018-05-11
Posts: 15

Re: CPU Frequency always at minimum, except when resume after suspend

ooo wrote:

What happens if you stress your cpu, by running cpuburn for each core for example?

performance governor should run the cpu with maximum frequency when using acpi-cpufreq driver.
With intel_pstate frequency will be dynamically scaled regardless of the governor being used.

Thanks for your reply. I have tried using stress-ng for stress testing, and the CPU is ramped up to 100% but the frequencies reported remain at minimum, 400MHz. I have tried monitoring with both /proc/ and with cpupower -montior. They both report the same output, regardless of the governor set. Any other suggestions?

Edit:

ooo wrote:

One possibility is, that your cpu frequency is ramped down because your system is overheating.

I have checked this, and the CPU temperatures are always under 45, which to my understanding, is normal? I have seen on other threads that this is the normal/average temperatures.

Last edited by dgs (2018-05-11 12:05:40)

Offline

#7 2018-05-11 15:52:57

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: CPU Frequency always at minimum, except when resume after suspend

You should fully update your system, to make sure this isn't fixed already somewhere. 4.16.3 isn't the latest kernel. Also test with linux-lts.

Have you tested if the issue persists with other operating systems?

Offline

#8 2018-05-11 16:12:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: CPU Frequency always at minimum, except when resume after suspend

What ooo said, and frequency issues might also stem from wonky UEFI/BIOS so try to update that as well.

Offline

#9 2018-05-11 16:19:29

dgs
Member
Registered: 2018-05-11
Posts: 15

Re: CPU Frequency always at minimum, except when resume after suspend

ooo wrote:

You should fully update your system, to make sure this isn't fixed already somewhere. 4.16.3 isn't the latest kernel. Also test with linux-lts.

Have you tested if the issue persists with other operating systems?

Thanks for the suggestions. I have tested with other Linux distros: AntergOS, Linux Mint, and Manjaro. The issue persists on all of them which makes me doubt it's related to the kernel. I should indeed update the system and I will definitely throw in an LTS, However, I seem to have found a solution, albeit temporary, I guess.

So far, the only thing that has worked is to disable BD PROCHOT via msr-tools, as well as enforcing the acpi driver by disabling intel_pstate. As soon as the PROCHOT bit is set to 0 instead of 1, the frequencies shoot up and the lag ends. I have tried stressing the system for a while now and the temperatures don't go over 70C, which is fine according to the i5's spec sheet 100C T Junction on the Intel site.

I suppose I could write some aliases to crank up the frequency when I need it, to save battery power when I don't. Or, some bash scripts to disable PROCHOT during boot up and after resuming from suspend. Only downside to this is that even when idling , the frequencies are running at around 1000MHz which is less than half the max clock speed, but would give me a longer battery life and the fact that it'd be a bit cumbersome to have to manually disable/enable prochot whenever needed. The machine is much more responsive now, however.

Any other suggestions are welcome, and thanks again!

Offline

#10 2018-05-11 17:02:35

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: CPU Frequency always at minimum, except when resume after suspend

Sounds like firmware/hardware issue then. Definitely check for available BIOS updates as V1del already suggested.

Offline

Board footer

Powered by FluxBB