You are not logged in.
Pages: 1
I was having an enormous amount of trouble with CPU scaling and governors in Linux until I read, and followed this guide: "http://technowizah.com/2007/01/debian-h … ement.html"
Think this will help some people out 
Here it is:
CPU frequency management is one of the keys to power preservation.
The Linux kernel now provides all the necessary tools to properly manage CPU frequency : no need to use a daemon (like cpufreqd or powernowd) to take care of your CPU.
Of course the benefits of such power management are obvious for a laptop, but most desktop users should also consider this.
In this tutorial, I use sudo to get root privileges.
Prerequisites
Debian Etch (and Sid) should automatically configure CPU frequency management on most processors that supports it, so it might very well be already enabled. You can verify if that is the case using this command :
cpufreq-info
and analyze the output regarding the current policy.
If CPU frequency management is off (or the command is not found), then you can go on with this tutorial.
In order to make this work, you need to install the required packages:
sudo apt-get install cpufrequtils sysfsutils
Next, verify your exact CPU model :
cat /proc/cpuinfo | grep "model name"
Which should output something like that :
model name : Intel(R) Pentium(R) M processor 1.73GHz
Once you know your exact CPU type, the next step is to load the proper modules : the CPU frequency driver and the CPU frequency policy governor.
CPU frequency driver
As you may guess the CPU frequency driver will differ depending on your type of CPU. For example, my laptop is equipped with a Pentium M, so I type :
sudo modprobe speedstep_centrino
to load the proper driver.
Some of the other common drivers (or modules) are :
AMD K6 processors : powernow_k6
AMD K7 processors (Athlon, Duron, Sempron 32 bits) : powernow_k7
AMD K8 processors (Athlon 64, Turion 64, Sempron 64, Opteron 64) : powernow_k8
Pentium 4, Celeron D, Pentium D, Celeron M : p4_clockmod
Pentium M, Core Duo, Core 2 Duo : speedstep_centrino
There are of course other CPU frequency drivers. In doubt, you can use the generic driver : acpi_cpufreq
CPU policy governor
Once the proper driver is loaded, you need to choose the desired CPU policy governor. This policy governor will manage the actual behavior of your CPU. Here is some policy governors and their module names :
performance, which sets the CPU statically to the highest possible frequency : cpufreq_performance
powersave, which is the opposite, clocks the CPU statically to the lowest frequency : cpufreq_powersave
ondemand, which sets the CPU speed dynamically depending on the work load (ideal for desktops) : cpufreq_ondemand
conservative, which also sets the CPU dynamically, but less aggressively then the ondemand governor (ideal for laptops) : cpufreq_conservative
For example, my machine has a Pentium M processor, so I type :
sudo modprobe speedstep_centrino
sudo modprobe cpufreq_ondemand
to load both the CPU frequency driver and the CPU policy governor.
CPU configuration
Once the modules are loaded, you need to configure the policy governor. For example, I use the ondemand governor, so :
echo ondemand | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
will enable it.
You can verify that everything went well with this command :
cpufreq-info
It should output your actual frequency, as well as the governor presently in use.
System configuration
If everything is good, then you can make this configuration permanent. First make sure the proper modules are loaded at startup (in /etc/modules).
So in my case :
echo speedstep_centrino | sudo tee -a /etc/modules
echo cpufreq_ondemand | sudo tee -a /etc/modules
Finally, ensure that the CPU uses your policy governor of choice by default. Simply edit the file /etc/sysfs.conf with a line like this one :
devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
That's it !
Thinkpad x120e 8GB DDR3, 1.6Ghz X2 - Laptop/Netbook
AMD Athlon X2 OC'ed to 3.33GHz, 4GB DDR2 2TBx2 - Desktop/Seedbox
Offline
Thanks a lot for this tutorial.
After installing cpufrequtils and sysfsutils frequency scaling worked immediately with the ondemand governor. I changed it to conservative.
Just one remark for completeness:
if you have a multiprocessor system (dualcore, quadcore ...) like me, you don't have a single cpu device "cpu0" but also "cpu1" and so on. So, in this case there are some more lines to edit ...
Again, thank you
EJ
Thinkpad X220 with 1.gen Samsung SSD on #! Statler XFCE (unstable repos)
Offline
heya.
just wanted to add, that i had the same problem: cpu was running on highest freq.
but what helped me, wasnt quite that nice tutorial but simply running sensors-detect. once run, my cpu went down to the lowest possible freq. (which is, naively spoken, not much different to the manual steps of the tutorial, afaik..)
so i guess, running sensors-detect would be first advised to the tutorial, right?
in any case,
greetings, alex.
Offline
Thank you - this was really useful for me.
Offline
The speedstep-centrino module is deprecated (as of 2.6.30, I think) and its functionality is included in module acpi_cpufreq. Despite being deprecated, speedstep-centrino.ko is still available in the latest kernel 2.6.37, subject to the build configuration. I've seen comments that acpi_cpufreq doesn't work on some speedstep-capable processors but when it works it should work better. It supports both enhanced speedstep and processor p-states.
There is an additional governer not mentioned so far: userspace. It doesn't do anything for itself but does let you control the speedstep setting manually, using a daemon, or using another program.
The p4_clockmod module is not especially useful, which is why speedstep was invented I guess. Details depend on your processor but most can't scale back the clock very much and just skipping clock cycles to save power is no different from what the CPU does anyway when it is idle. Try it but examine carefully what you're actually getting.
Offline
Thanks a lot for this tutorial.
After installing cpufrequtils and sysfsutils frequency scaling worked immediately with the ondemand governor. I changed it to conservative.
Just one remark for completeness:
if you have a multiprocessor system (dualcore, quadcore ...) like me, you don't have a single cpu device "cpu0" but also "cpu1" and so on. So, in this case there are some more lines to edit ...Again, thank you
EJ
Hello. I have the same situation.
I followed the tutorial, and it helped. The processor is more stable, less noise, usage remains below 50%, but I need some tips on enabling the second core. I'd like to use all the system has to offer. #! Is the best O-system I've found yet. Good f/s encryption, simple login, reasonably customizable, lots of software support. I just stopped using ubuntu-like distrobutions. (What you get in a painless install results in a sloppy/bloated OS *usually.)
nproctells me I've only one processor core, but I know from running full installation OS's like Ubuntu that nproc should output 2.
cat /proc/cpuinfo | grep "model name"
model name : Intel(R) Pentium(R) 4 CPU 3.00GHzanother output for processor information
:/etc# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 9
microcode : 0x11
cpu MHz : 3000.000
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
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 pebs bts cid xtpr
bogomips : 5939.65
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:Any suggestions would be great. I will try to enable my second core like you said, but I'm unsure it will work.
Maybe it's cooked, who knows.
Offline
Maybe it's to early, but I really hope to fix this so......
BUMP
Offline
You have not mentioned what kernel version you are running, nor what architecture.
I guess it is 32-bit. #! installs a -486 kernel by default. You will have to upgrade your kernel to -686.
hth
bootinfoscript - emacs primer - I ♥ #!
Offline
You have not mentioned what kernel version you are running, nor what architecture.
I guess it is 32-bit. #! installs a -486 kernel by default. You will have to upgrade your kernel to -686.
hth
Here is the output for
uname -aI am guessing you were right?
/proc# uname -a
Linux localhost 3.2.0-0.bpo.1-486 #1 Thu Jan 26 00:51:35 UTC 2012 i686 GNU/LinuxIf I need to upgrade my architecture support, could you suggest how that is to be done.
Thanks a lot.
Last edited by lightning_underscore (2012-02-04 19:53:43)
Offline
Impatience is my problem... (I find someone who can help, they go offline.)
BUMP
Offline
Please, don't bump so much. Someone who knows the answer will come across this post 
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github || Deviantart
Offline
Open Synaptic, find the package called linux-image-3.2.0-0.bpo.1-686-pae and linux-headers-3.2.0-0.bpo.1-686-pae. install, reboot, you're done.
Offline
Open Synaptic, find the package called linux-image-3.2.0-0.bpo.1-686-pae and linux-headers-3.2.0-0.bpo.1-686-pae. install, reboot, you're done.
Hey thanks, but I figured it out..
I AM A MORON. JK 
Thanks for those who helped me figure that out.
Special thanks to eL Koraco
Last edited by lightning_underscore (2012-02-04 20:41:38)
Offline
Thanks for the tips and link. My I7 was chewing up power and making a whole lot of racket in the process. Since it's a multi-core I had to rinse-repeat and that got old so I did what any geek would do... bashed it.
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.