LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-23-2012, 01:53 PM   #1
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Rep: Reputation: Disabled
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.
 
Old 08-23-2012, 02:03 PM   #2
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Try:
Code:
sudo cpufreq-set -c 0 -f 3600
 
Old 08-23-2012, 02:10 PM   #3
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by byannoni View Post
Try:
Code:
sudo cpufreq-set -c 0 -f 3600
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.
 
Old 08-23-2012, 02:15 PM   #4
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Edit: Ignore this post.

Last edited by byannoni; 08-23-2012 at 02:29 PM.
 
Old 08-23-2012, 02:16 PM   #5
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by byannoni View Post
Does it ever drop back down to 1600000? It is just going up there.
I just updated my previous reply with more data which indirectly answered this question. See above...
 
Old 08-23-2012, 02:26 PM   #6
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Edit3: What is the output of these commands:
Code:
cat /proc/cpuinfo
lsmod | grep freq

Last edited by byannoni; 08-23-2012 at 02:34 PM.
 
Old 08-23-2012, 02:35 PM   #7
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
The architecture of the host in question is:

Dual X5687 @ 3.60GHz

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.
 
Old 08-23-2012, 02:39 PM   #8
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Code:
lsmod | grep freq
No output

Code:
cat /proc/cpuinfo
produces the following for each of the 16 virtual CPUs:
Code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           X5687  @ 3.60GHz
stepping        : 2
microcode       : 0x14
cpu MHz         : 3601.000
cache size      : 12288 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 7200.09
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
Out of desperation I also tried doing:

Code:
sudo modprobe speedstep-lib
This didn't change the behavior of frequencies changing...

In /lib/modules/3.2.0-23-generic/kernel/drivers/cpufreq, I have:

Code:
-rw-r--r-- 1 root root 11016 Apr 10 19:27 p4-clockmod.ko
-rw-r--r-- 1 root root 14112 Apr 10 19:27 pcc-cpufreq.ko
-rw-r--r-- 1 root root 10288 Apr 10 19:27 speedstep-lib.ko
Out of these only speedstep-lib is loadable as a module, but doesn't seem to change any of the perceived behavior.

Last edited by mgoldshteyn; 08-23-2012 at 02:47 PM.
 
Old 08-23-2012, 07:06 PM   #9
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Try this:
Code:
sudo modprobe p4_clockmod

Last edited by byannoni; 08-23-2012 at 07:10 PM.
 
Old 08-23-2012, 07:09 PM   #10
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
That doesn't work

Code:
sudo modprobe p4_clockmod
give me an error. Only speedstep-lib seems to work out of the three I listed.
 
Old 08-23-2012, 07:11 PM   #11
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
What error?
 
Old 08-23-2012, 07:13 PM   #12
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by byannoni View Post
What error?
The exact message is:

Code:
FATAL: Error inserting p4_clockmod (/lib/modules/3.2.0-23-generic/kernel/drivers/cpufreq/p4-clockmod.ko):
Device or resource busy
 
Old 08-23-2012, 07:17 PM   #13
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Try:
Code:
sudo rmmod speedstep-lib
sudo modprobe p4_clockmod
If that doesn't work, do this:
Code:
sudo /bin/echo "p4_clockmod" >> /etc/modules
sudo reboot
 
Old 08-23-2012, 07:37 PM   #14
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Rep: Reputation: 38
Is the acpi-cpufreq daemon active? I modprobed this and my cpuinfo started registering my correct frequency setting.

Alex Brinister

---------- Post added 08-23-12 at 08:38 PM ----------

If you load the wrong module, it will give you that error. More here.

Alex Brinister
 
Old 08-23-2012, 07:48 PM   #15
mgoldshteyn
LQ Newbie
 
Registered: Aug 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by abrinister View Post
Is the acpi-cpufreq daemon active? I modprobed this and my cpuinfo started registering my correct frequency setting.
Yes, acpi-cpufreq is loaded. A quote from the original question (and reply #3), above:

Quote:
analyzing CPU 0:
driver: acpi-cpufreq
...
Although, perhaps strangely:
Code:
modinfo acpi-cpufreq
gives:
Code:
ERROR: modinfo: could not find module acpi-cpufreq
Just to be certain, I performed an:
Code:
su modprobe acpi-cpufreq
which completed silently, but modinfo still gives an error indicating that it could not find the module.

Last edited by mgoldshteyn; 08-23-2012 at 07:54 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cpufreq directory not present. How to change governor for P states in such a case kashyapa Linux - General 7 11-03-2009 02:58 PM
cpufreq directory not present. How to change governor for P states in such a case kashyapa Programming 1 10-29-2009 08:27 AM
Default cpufreq governor not according to kernel config?! Olaus Slackware 7 09-23-2009 02:08 AM
cpufreq governor problems on Thinkpad T21 dive Linux - Kernel 2 07-11-2008 04:25 PM
anyone know how to setup 'ondemand' governor with cpufreq ? -=Graz=- Ubuntu 3 05-15-2006 06:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration