Howto get CPU frequency scaling to work in 2.xx
Howto get CPU frequency scaling to work in 2.xx
Here's how to get CPU frequency scaling to work in Puppy 2.xx:
(these examples are for a 'centrino' laptop with a Pentium-M, but modules are included for many types of CPU)
For 2.13 and 2.14, you don't need to download anything - the necessary modules are already included in zdrv_2.13/2.14. Just make sure that file is copied to the same location as your pup_213/214 file.
-----------------------------------------------------------------------
Only for 2.11/2.12:
Download http://www.puppyos.com/test/all-modules ... 202.tar.gz
From the file all-modules-k2.6.16.7-PUP202.tar.gz, extract the modules from
all-modules/kernel/arch/i386/kernel/cpu/cpufreq/
and
all-modules/kernel/drivers/cpufreq/
and copy them all into a new Puppy folder /lib/modules/2.6.16.7/cpufreq/
Run depmod so Puppy will find the new modules
# depmod
-----------------------------------------------------------------------
Also see HairyWill's post further down on this page
Load these modules:
# modprobe cpufreq_userspace
# modprobe speedstep_centrino
See what CPU frequency settings are avaiable:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
1600000 1600000 1600000 1400000 1200000 1000000 800000 600000
Check the current frequency setting:
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1600000
I chose to lower the CPU freq to 1GHz (lower heat, quieter fan but still snappy response on my Dell Inspiron 510m with 1.6GHz Dothan Pentium-M)
# echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Check again the current frequency setting:
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1000000
This is how you would set the CPU freq manually. There are other "governors" (ie, mechanisms to steer the CPU frequency) available:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
userspace performance
If you also load modules "cpufreq_powersave" and "cpufreq_conserative" you'll get even more governors to play with:
# modprobe cpufreq_powersave
# modprobe cpufreq_conservative
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative powersave userspace performance
I can't remember exactly how the governors work but info can be found on the net. "conservative" "powersave" "performance" all adjust the CPU freq automatically using different algorithms.
To use a different governor, e.g. "powersave":
# echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
To have the settings I want at bootup, I put these lines in /etc/rc.d/rc.local:
modprobe cpufreq_userspace
modprobe speedstep_centrino
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Paul
(these examples are for a 'centrino' laptop with a Pentium-M, but modules are included for many types of CPU)
For 2.13 and 2.14, you don't need to download anything - the necessary modules are already included in zdrv_2.13/2.14. Just make sure that file is copied to the same location as your pup_213/214 file.
-----------------------------------------------------------------------
Only for 2.11/2.12:
Download http://www.puppyos.com/test/all-modules ... 202.tar.gz
From the file all-modules-k2.6.16.7-PUP202.tar.gz, extract the modules from
all-modules/kernel/arch/i386/kernel/cpu/cpufreq/
and
all-modules/kernel/drivers/cpufreq/
and copy them all into a new Puppy folder /lib/modules/2.6.16.7/cpufreq/
Run depmod so Puppy will find the new modules
# depmod
-----------------------------------------------------------------------
Also see HairyWill's post further down on this page
Load these modules:
# modprobe cpufreq_userspace
# modprobe speedstep_centrino
See what CPU frequency settings are avaiable:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
1600000 1600000 1600000 1400000 1200000 1000000 800000 600000
Check the current frequency setting:
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1600000
I chose to lower the CPU freq to 1GHz (lower heat, quieter fan but still snappy response on my Dell Inspiron 510m with 1.6GHz Dothan Pentium-M)
# echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Check again the current frequency setting:
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1000000
This is how you would set the CPU freq manually. There are other "governors" (ie, mechanisms to steer the CPU frequency) available:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
userspace performance
If you also load modules "cpufreq_powersave" and "cpufreq_conserative" you'll get even more governors to play with:
# modprobe cpufreq_powersave
# modprobe cpufreq_conservative
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative powersave userspace performance
I can't remember exactly how the governors work but info can be found on the net. "conservative" "powersave" "performance" all adjust the CPU freq automatically using different algorithms.
To use a different governor, e.g. "powersave":
# echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
To have the settings I want at bootup, I put these lines in /etc/rc.d/rc.local:
modprobe cpufreq_userspace
modprobe speedstep_centrino
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Paul
Last edited by pakt on Fri 09 Mar 2007, 11:05, edited 1 time in total.
Those modules will not work with kernel 2.6.18.1nilsja wrote: i get the error "invalid module format".
Does only work with kernel 2.6.16.7 ?
The good news is that the modules you want are included in zdrv_213.sfs. Just make sure you put that file in the same directory as pup_save.2fs. Then when you reboot, the modules will be available to you.
Paul
Methinks Raspberry Pi were ideal for runnin' Puppy Linux
-
- Posts: 286
- Joined: Tue 16 Aug 2005, 03:47
- Location: Appalachian Mountains
Thanks!
Thanks. This is GREAT! I have made so much progress on getting all the "iches" to work on my laptop and this was a big one that I don't have to fix!
Battery, LCD Brightness, SMP, Suspend 2 Disk, CPU scaleing.............
Thanks so much Paul.
Battery, LCD Brightness, SMP, Suspend 2 Disk, CPU scaleing.............
Thanks so much Paul.
I get the same problem as nilsja! could someone please explain in simple terms what file i need to put into the zdrv directory?
I'm running on usb stick so i guess the right directory is
initrd/mnt/dev_save
(it shows pup save, zdrv etc)
Im using puppy 2.15ce alpha, with athlon 3200+
Thanks!
I'm running on usb stick so i guess the right directory is
initrd/mnt/dev_save
(it shows pup save, zdrv etc)
Im using puppy 2.15ce alpha, with athlon 3200+
Thanks!
Download a better Computer :)
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
headfound
You don't need to do anything to the zdrv file you just need to have it stored next to your pup_215.sfs all the necessary modules are probably in there.
I use 2.14, I'm assuming that nothing has been removed for 2.15.
When you try a modprobe for a driver that isn't in the main file the system automatically checks to see if you have a zdrv file and then loads it from there.
So all I do is:You can enter these in a terminal, this is actually copied from my /etc/rc.d/rc.local. Every boot this sets my system to manage my processor speed ondemand ie speeds up when the load is heavy.
To find out which processor you should be modprobing for I suggest you do cat /proc/cpuinfo and then hit google.
Pakt
I know the thread title says 2.11, you might want to consider stating this again in this first post so that those with later kernels don't use your file. Probably better would be to change the thread title to something less version specific and then giving some options. Its your thread, just my opinion. Thanks for the advice by the way, without your explanation I'd never have have considered it was this easy, now I get another 15 minutes of battery life.
You don't need to do anything to the zdrv file you just need to have it stored next to your pup_215.sfs all the necessary modules are probably in there.
I use 2.14, I'm assuming that nothing has been removed for 2.15.
When you try a modprobe for a driver that isn't in the main file the system automatically checks to see if you have a zdrv file and then loads it from there.
So all I do is:
Code: Select all
modprobe cpufreq_userspace
modprobe acpi-cpufreq #this line is processor dependant
modprobe cpufreq_conservative
modprobe cpufreq_ondemand
modprobe cpufreq_powersave
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
To find out which processor you should be modprobing for I suggest you do cat /proc/cpuinfo and then hit google.
Pakt
I know the thread title says 2.11, you might want to consider stating this again in this first post so that those with later kernels don't use your file. Probably better would be to change the thread title to something less version specific and then giving some options. Its your thread, just my opinion. Thanks for the advice by the way, without your explanation I'd never have have considered it was this easy, now I get another 15 minutes of battery life.
Last edited by HairyWill on Wed 14 Jan 2009, 17:41, edited 1 time in total.
Thanks for your help HairyWill, your code seemed to work ok, unfortunately when i try to modprobe current frequencies etc it can't find anything. Never mind! Now to try to get lm-sensors working to slow down the power supply fan....
Download a better Computer :)
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
-
- Posts: 176
- Joined: Fri 07 Apr 2006, 06:21
This is what I get on my home computer, a HP a310n pavilion with Puppy 2.14-all-modules installed to the hard drive (PUPMODE 2):
sh-3.00# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Celeron(R) CPU 2.70GHz
stepping : 9
cpu MHz : 2691.425
cache size : 128 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 cid xtpr
bogomips : 5385.52
sh-3.00# modprobe cpufreq_userspace
sh-3.00# modprobe acpi-cpufreq
sh-3.00# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such file or directory
sh-3.00#
sh-3.00# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Celeron(R) CPU 2.70GHz
stepping : 9
cpu MHz : 2691.425
cache size : 128 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 cid xtpr
bogomips : 5385.52
sh-3.00# modprobe cpufreq_userspace
sh-3.00# modprobe acpi-cpufreq
sh-3.00# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such file or directory
sh-3.00#
Ed
I think the driver for your processor should be p4_clockmod
so instead oftry
good link showing different processor modules here:
http://doc.gwos.org/index.php/CPUFreq
headfoundshould get you your current processor speed
I think the driver for your processor should be p4_clockmod
so instead of
Code: Select all
modprobe acpi-cpufreq (this generally seems a last resort)
Code: Select all
modprobe p4_clockmod
http://doc.gwos.org/index.php/CPUFreq
headfound
I'm not sure what you mean by modprobe current frequencies. After loading all the modules doingThanks for your help HairyWill, your code seemed to work ok, unfortunately when i try to modprobe current frequencies etc it can't find anything.
Code: Select all
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
Success!!
Thanks Will. I think before I must've done something in the wrong order, but I just followed everything from both posts and now i'm down by half!
Thanks again!
Thanks Will. I think before I must've done something in the wrong order, but I just followed everything from both posts and now i'm down by half!
Thanks again!
Download a better Computer :)
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]
-
- Posts: 176
- Joined: Fri 07 Apr 2006, 06:21
That worked Will.
I put this in rc.local:
Thanks everyone. Now I'm off to try to solve the processor fan speed problem I'm having. It seems my processor temperture is always -236C and the fan runs slow.
This should help that as well.
Ed
I put this in rc.local:
Code: Select all
modprobe cpufreq_userspace
modprobe p4_clockmod
echo 2362500 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
This should help that as well.
Ed
Thanks I did get the ball rolling by being the first to recompile Puppy's kernel with the CPU frequency scalling options enabled and getting it to work on my Pentium-M laptop. Barry then enabled the options in the next Puppy, and eventually added the extra modules in zdrv_2xx.sfs.HairyWill wrote:All credit to pakt for putting the drivers up in the first place, I presume it was him that got them included in the zdrv.
Glad you guys got it working too
Paul
Methinks Raspberry Pi were ideal for runnin' Puppy Linux
Scratch what I just said, I did a big error. my badHi, I tried your methods and failed. I have v2.14 - so i should use the zdrv_214 file somehow. I am unsure of how to do it.
I am currently booting from usb. The zdrv_214 file is in /initrd/mnt/dev_save/zdrv_214.sfs - however, when I modprobe it says that the speedstep_centrino does not exist
Assuming that you are managing to load the other modules. My guess is that you are not loading the right module for your processor.
HairyWill wrote:To find out which processor you should be modprobing for I suggest you do cat /proc/cpuinfo and then hit google.
HairyWill wrote:good link showing different processor modules here:
http://doc.gwos.org/index.php/CPUFreq
I made script for cpu power save. And it my first script !
And localize it
Please try it and tell me about bugs.
But I do it in PuppyRus 3.01.
It run from command line:
cpu_power_save --options
And localize it
Please try it and tell me about bugs.
But I do it in PuppyRus 3.01.
It run from command line:
cpu_power_save --options
- Attachments
-
- cpu_power_save_loc.pet
- (1.68 KiB) Downloaded 590 times