The performance governor for cpufreq doesn't seem to behave as advertised
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The performance governor for cpufreq doesn't seem to behave as advertised
The kernel in use: 3.2.0-23-generic on Ubuntu 12.04LTS
For example, I issue the following command:
Code:
sudo cpufreq-set -c 0 -g performance
Then I go to /sys/devices/system/cpu/cpu0/cpufreq and type in the following:
Code:
sudo cat cpuinfo_cur_freq
Sometimes I get the max frequency (3600 MHz) when I do this and sometimes I get the min frequency (1600 MHz).
If I do:
Code:
cat scaling_governor
The output is performance, showing that the governor is in fact set to performance.
Then, to make it even more weird, if I do:
Code:
cpufreq-info
I get:
Code:
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3 8 9 10 11
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.60 GHz - 3.60 GHz
available frequency steps: 3.60 GHz, 3.60 GHz, 3.47 GHz, 3.33 GHz, 3.20 GHz, 3.07 GHz, 2.93 GHz, 2.80 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 3.60 GHz and 3.60 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 3.60 GHz.
...
If you look at the current policy above, you will notice that it is telling me that the CPU should be pegged at 3.60 GHz. Yet, polling (i.e., displaying) cpuinfo_cur_freq once a second seems to tell a different story.
I tried this route as well and I just tried it again to be certain. I still get intermittent results with frequencies of 1.6 GHz and 3.6 GHz.
cpufreq-info reports:
Code:
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3 8 9 10 11
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.60 GHz - 3.60 GHz
available frequency steps: 3.60 GHz, 3.60 GHz, 3.47 GHz, 3.33 GHz, 3.20 GHz, 3.07 GHz, 2.93 GHz, 2.80 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 3.60 GHz and 3.60 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 3.60 GHz.
cpufreq stats: 3.60 GHz:83.88%, 3.60 GHz:16.12%, 3.47 GHz:0.00%, 3.33 GHz:0.00%, 3.20 GHz:0.00%, 3.07 GHz:0.00%, 2.93 GHz:0.00%, 2.80 GHz:0.00%, 2.67 GHz:0.00%, 2.53 GHz:0.00%, 2.40 GHz:0.00%, 2.27 GHz:0.00%, 2.13 GHz:0.00%, 2.00 GHz:0.00%, 1.87 GHz:0.00%, 1.73 GHz:0.00%, 1.60 GHz:0.00% (2612)
...
Results:
Code:
/sys/devices/system/cpu/cpu0/cpufreq$ for i in {1..5}; do sudo cat cpuinfo_cur_freq; sleep 1; done
1600000
3600000
1600000
1600000
3600000
Last edited by mgoldshteyn; 08-23-2012 at 02:13 PM.
So, 8 physical cores spread across two CPUs (16 virtual cores due to hyperthreading being turned on). EIST and C1E are turned on, all C states below 1 are turned off.
Last edited by mgoldshteyn; 08-23-2012 at 02:36 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.