PDA

View Full Version : Disabling CPU Throttlling



gossamer
29th November 2015, 03:29 AM
Hi,
I have a fedora22 server that never needs to have the CPU throttled. I've tried to effectively disable it using cpupower, and it seems to change it, but it's still not right:



[root@mail03 ~]# cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
[root@mail03 ~]# cat /proc/cpuinfo |grep Hz
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 3095.812
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 2340.421
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 3261.070
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 3167.355
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 2038.007
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1599.984
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1599.855
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 2734.617

What is the proper way to do this?

Does this module have anything to do with it, and if so, how do I disable it?


# lsmod|grep therm
x86_pkg_temp_thermal 16384 0

Perhaps it has something to do with ACPI? I've seen references to disabling that, but would I lose any other functionality?

marko
29th November 2015, 03:33 AM
what does this say?


cpupower frequency-info

gossamer
29th November 2015, 02:30 PM
what does this say?


# 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: 0.97 ms.
hardware limits: 1.60 GHz - 3.70 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 1.60 GHz and 3.70 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 1.72 GHz (asserted by call to hardware).
boost state support:
Supported: yes
Active: yes
3400 MHz max turbo 4 active cores
3500 MHz max turbo 3 active cores
3600 MHz max turbo 2 active cores
3700 MHz max turbo 1 active cores

Thanks for your help.

marko
29th November 2015, 06:35 PM
I was just wondering if somehow the performance setting didn't make it in. But what you're showing
looks okay.

PabloTwo
29th November 2015, 08:21 PM
With the newer generation of Intel cpu's, you cannot control the cpu frequency in the same manner as prior cpu's. The Intel cpu's that utilize the pstate driver control both their frequency and voltage level internally from within the cpu. You can't override that, and rightly so.

What you can control is to use either the powersave or performance governor, and to manually change settings in:

/sys/devices/system/cpu/intel_pstate/
Old news, but informative:

http://www.phoronix.com/scan.php?page=news_item&px=MTI5Mzc

And some explanation about what is a P-state:

https://software.intel.com/en-us/blogs/2008/05/29/what-exactly-is-a-p-state-pt-1

Some really smart engineers worked hard to figure out how to squeeze maximum performance out of a cpu with maximum energy/power savings and people still insist on defeating their efforts. What you could do on earlier generations of Intel cpu's with the acpi-cpufreq governor is no longer relevant on the newer cpu's.

marko
29th November 2015, 11:34 PM
Well, then shouldn't cpupower exit with a notice that your processor is new and cpupower is deprecated with it?

Your post 5 seems to imply that you can set the performance governor with pstate, so how does someone set the min and max frequency to
be equal and maximum?

is it :

cpupower frequency-set -g performance --min 3.1G --max 3.1G

for a maximum 3.1 gigahz cpu?

I tried that on my Ivy Bridge processor and got:

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: 0.97 ms.
hardware limits: 1.20 GHz - 3.10 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.10 GHz and 3.10 GHz. <<< seems to imply it worked
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 2.21 GHz (asserted by call to hardware). <<< nope, not 3.1g
boost state support:
Supported: yes
Active: yes
2900 MHz max turbo 4 active cores
2900 MHz max turbo 3 active cores
2900 MHz max turbo 2 active cores
3100 MHz max turbo 1 active cores

So apparently that doesn't work and there's no point to using pstate with performance governor?

Here's some recent looking info for Arch Linux, it should apply to Fedora
https://wiki.archlinux.org/index.php/CPU_frequency_scaling#Setting_maximum_and_minimum_ frequencies

I guess the idea is that intel-pstate is so effective that when the processor has work it ramps up in HZ so efficiently
there's not much point to quit using powersave governor

PabloTwo
30th November 2015, 02:07 AM
Well, the cpupower program is still very useful, but it's not quite up to speed as yet in understanding the newer Intel chips or the intel_pstate driver. Yes, you can use it to report current status (though some of that status might be bogus) and to change which governor to use on the new breed of Intel cpu's and they have talk cpupower about turbo-boost, but that's about it. Most of the commands only apply to the acpi-cpufreq driver controlling the older Intel chips

$ ls /sys/devices/system/cpu/intel_pstate/
max_perf_pct min_perf_pct no_turbo num_pstates turbo_pct
To actually effect a lower or upper frequency/voltage limit you manipulate the items in bold above, maximum_performance_percentage and minimum_performance_percentage. cpupower can't do that as yet to my knowledge.

$ cat /sys/devices/system/cpu/intel_pstate/*
100
38
0
20
31
So by default, I see the max_perf_pct is set to 100%. This works. On my desktop PC with an i5-2500k when compiling a kernel and with conky monitoring cpu utilization of each core, I have witnessed all four cores maxed out at the frequency allowed by Turbo-Boost and 100% cpu utilization. You can think of the newer Intel cpu chips as actually behaving more akin to the acpi-cpufreq drivers "ondemand" governor, only in a much more sophisticated manner.

As for raising the floor (minimum idle frequency) with the min_perf_pct, just raise the value for that. I tried this and it works. In any case, manually changing those values won't survive a reboot.

gossamer
30th November 2015, 02:46 PM
Well, the cpupower program is still very useful, but it's not quite up to speed as yet in understanding the newer Intel chips or the intel_pstate driver. Yes, you can use it to report current status (though some of that status might be bogus) and to change which governor to use on the new breed of Intel cpu's and they have talk cpupower about turbo-boost, but that's about it. Most of the commands only apply to the acpi-cpufreq driver controlling the older Intel chips

$ ls /sys/devices/system/cpu/intel_pstate/
max_perf_pct min_perf_pct no_turbo num_pstates turbo_pct
To actually effect a lower or upper frequency/voltage limit you manipulate the items in bold above, maximum_performance_percentage and minimum_performance_percentage. cpupower can't do that as yet to my knowledge.

$ cat /sys/devices/system/cpu/intel_pstate/*
100
38
0
20
31
So by default, I see the max_perf_pct is set to 100%. This works. On my desktop PC with an i5-2500k when compiling a kernel and with conky monitoring cpu utilization of each core, I have witnessed all four cores maxed out at the frequency allowed by Turbo-Boost and 100% cpu utilization. You can think of the newer Intel cpu chips as actually behaving more akin to the acpi-cpufreq drivers "ondemand" governor, only in a much more sophisticated manner.

As for raising the floor (minimum idle frequency) with the min_perf_pct, just raise the value for that. I tried this and it works. In any case, manually changing those values won't survive a reboot.

Thanks for the info. I'm looking at my system, and the max_perf_pct and min_perf_pct were already 100, but it doesn't seem to have any effect on the processors:


# cat /proc/cpuinfo |grep Hz
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1989.667
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1850.578
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1599.984
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1599.984
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1939.007
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 2028.082
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1945.710
model name : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
cpu MHz : 1972.136

If I cat cpuinfo again, the values could change dramatically, including reaching 3400 Hz. What else could be wrong?


# cat /sys/devices/system/cpu/intel_pstate/*
100
100
0
22
19

PabloTwo
30th November 2015, 03:41 PM
Interesting, but I find when I experiment with raising the min_perf_pct value on my laptop system (i5-3210M CPU @ 2.50GHz] from it's default low value of 38, it raises the average min idle frequency but does not set it to some strict lower limit. My normal cpu idle frequency is ~1.20GHz.

Here is a test I just ran, first output with stock lower limit of 38:

[paul@Brody ~]$ grep MHz /proc/cpuinfo
cpu MHz : 1292.187
cpu MHz : 1237.304
cpu MHz : 1231.054
cpu MHz : 1287.109
Then bumping that number up to 100 and checking at intervals a few seconds apart:

[paul@Brody ~]$ su -c 'echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct'
Password:
[paul@Brody ~]$ grep MHz /proc/cpuinfo
cpu MHz : 1780.664
cpu MHz : 2589.453
cpu MHz : 1329.394
cpu MHz : 2593.652
[paul@Brody ~]$ grep MHz /proc/cpuinfo
cpu MHz : 2644.433
cpu MHz : 2427.343
cpu MHz : 1640.039
cpu MHz : 1493.750
[paul@Brody ~]$ grep MHz /proc/cpuinfo
cpu MHz : 2463.378
cpu MHz : 2141.894
cpu MHz : 1666.308
cpu MHz : 2310.449
Then setting it back to stock lower limit:

[paul@Brody ~]$ su -c 'echo 38 > /sys/devices/system/cpu/intel_pstate/min_perf_pct'
Password:
[paul@Brody ~]$ grep MHz /proc/cpuinfo
cpu MHz : 1214.550
cpu MHz : 1283.300
cpu MHz : 1207.128
cpu MHz : 1217.968
You can clearly see the overall increase in idle speed when bumped up to 100% over the stock 38% idle minimum (just a single tab in the chrome browser and a terminal running on the system at the time). Did you confirm that that second "100" is indeed the value for min_perf_pct and not another setting. It could also be that xzeon series of cpu's behave a bid differently.

In short, you're not going to be able to force your cpu cores to run at max frequency 100% of the time. And why would you want to do that anyway? Just to generate lots of heat and make your cooling fan(s) run at max all the time and shorten the life of the cpu itself?

PabloTwo
30th November 2015, 04:58 PM
If I cat cpuinfo again, the values could change dramatically, including reaching 3400 Hz. What else could be wrong?
The cpu itself determines both frequency and voltage level applied to the cpu dynamically. They are never static. They can change in intervals of a very few milliseconds, much faster than any monitoring program can follow. The pstate driver can just set limits, but those limits are themselves not rigid numbers. If you want a cpu that you can set to a specific frequency and that will stay there, get yourself an older Pentium 4 processor.

gossamer
1st December 2015, 02:01 AM
Great info, thanks everyone. I know the older processors I had weren't responsive enough interactively to automatically adjust the processor speed automatically, and I hadn't realized it had improved so much recently.