| Author |
Message |
pakt

Joined: 04 Jun 2005 Posts: 1089 Location: Sweden
|
Posted: Sat 21 Oct 2006, 12:38 Post subject:
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-k2.6.16.7-PUP202.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, 07:05; edited 1 time in total
|
|
Back to top
|
|
 |
nilsja
Joined: 21 Jan 2007 Posts: 19
|
Posted: Mon 29 Jan 2007, 08:46 Post subject:
|
|
hi pakt,
i extracted the files from
all-modules/kernel/arch/i386/kernel/cpu/cpufreq/
and
all-modules/kernel/drivers/cpufreq/
to /lib/modules/2.6.18.1/cpufreq
than made depmod
and when i try to modprobe, i get the error "invalid module format".
Does only work with kernel 2.6.16.7 ?
|
|
Back to top
|
|
 |
pakt

Joined: 04 Jun 2005 Posts: 1089 Location: Sweden
|
Posted: Mon 29 Jan 2007, 11:37 Post subject:
|
|
| nilsja wrote: | i get the error "invalid module format".
Does only work with kernel 2.6.16.7 ? | Those modules will not work with kernel 2.6.18.1
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
_________________ Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart 
|
|
Back to top
|
|
 |
nilsja
Joined: 21 Jan 2007 Posts: 19
|
Posted: Mon 29 Jan 2007, 20:39 Post subject:
|
|
pakt,
you are a magician.
thx
_________________ Nils
puppy addicted, currently running pizzapup beta 3 (2.6.18.1) on a R51
|
|
Back to top
|
|
 |
pakt

Joined: 04 Jun 2005 Posts: 1089 Location: Sweden
|
Posted: Tue 30 Jan 2007, 03:16 Post subject:
|
|
| nilsja wrote: | pakt,
you are a magician. |
Thanks, but it is BarryK who is the magician
_________________ Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart 
|
|
Back to top
|
|
 |
brad_chuck
Joined: 15 Aug 2005 Posts: 284 Location: Appalachian Mountains
|
Posted: Thu 01 Feb 2007, 10:20 Post subject:
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.
|
|
Back to top
|
|
 |
headfound

Joined: 24 Jun 2006 Posts: 330 Location: England
|
Posted: Thu 08 Mar 2007, 14:37 Post subject:
|
|
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!
_________________ Don't buy a new computer - download a better one! Puppy Linux is cool.
Puppy Linux Song - http://uk.youtube.com/watch?v=rDTLJYDHX3g
|
|
Back to top
|
|
 |
HairyWill

Joined: 26 May 2006 Posts: 2949 Location: Southampton, UK
|
Posted: Fri 09 Mar 2007, 05:48 Post subject:
|
|
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: | Code: | 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 | 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.
_________________ Will
contribute: community website, screenshots, puplets, wiki, rss
Last edited by HairyWill on Wed 14 Jan 2009, 13:41; edited 1 time in total
|
|
Back to top
|
|
 |
pakt

Joined: 04 Jun 2005 Posts: 1089 Location: Sweden
|
Posted: Fri 09 Mar 2007, 06:47 Post subject:
|
|
Thanks for the tip, Will. I'll modify my first post.
Paul
_________________ Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart 
|
|
Back to top
|
|
 |
headfound

Joined: 24 Jun 2006 Posts: 330 Location: England
|
Posted: Fri 09 Mar 2007, 08:09 Post subject:
|
|
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....
_________________ Don't buy a new computer - download a better one! Puppy Linux is cool.
Puppy Linux Song - http://uk.youtube.com/watch?v=rDTLJYDHX3g
|
|
Back to top
|
|
 |
EdFromHouston
Joined: 07 Apr 2006 Posts: 176
|
Posted: Fri 09 Mar 2007, 15:07 Post subject:
|
|
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#
|
|
Back to top
|
|
 |
HairyWill

Joined: 26 May 2006 Posts: 2949 Location: Southampton, UK
|
Posted: Fri 09 Mar 2007, 15:54 Post subject:
|
|
Ed
I think the driver for your processor should be p4_clockmod
so instead of | Code: | | modprobe acpi-cpufreq (this generally seems a last resort) | try | Code: | | modprobe p4_clockmod |
good link showing different processor modules here:
http://doc.gwos.org/index.php/CPUFreq
headfound
| Quote: | | 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. | I'm not sure what you mean by modprobe current frequencies. After loading all the modules doing | Code: | | cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq | should get you your current processor speed
_________________ Will
contribute: community website, screenshots, puplets, wiki, rss
|
|
Back to top
|
|
 |
headfound

Joined: 24 Jun 2006 Posts: 330 Location: England
|
Posted: Fri 09 Mar 2007, 16:39 Post subject:
|
|
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!
_________________ Don't buy a new computer - download a better one! Puppy Linux is cool.
Puppy Linux Song - http://uk.youtube.com/watch?v=rDTLJYDHX3g
|
|
Back to top
|
|
 |
EdFromHouston
Joined: 07 Apr 2006 Posts: 176
|
Posted: Fri 09 Mar 2007, 16:52 Post subject:
|
|
That worked Will.
I put this in rc.local:
| Code: | modprobe cpufreq_userspace
modprobe p4_clockmod
echo 2362500 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
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
|
|
Back to top
|
|
 |
HairyWill

Joined: 26 May 2006 Posts: 2949 Location: Southampton, UK
|
Posted: Fri 09 Mar 2007, 17:17 Post subject:
|
|
headfound
Glad it works. I just happen to be going through the learming curve 5 minutes ahead of you. The first time I tried this was yesterday.
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.
_________________ Will
contribute: community website, screenshots, puplets, wiki, rss
|
|
Back to top
|
|
 |
|