CPUFreq can be very useful on laptops, and even on desktops; to set it up on Gentoo to work perfectly how you want it takes time, but once tweaked, CPUFreq can run very smoothly.
First, you need a kernel with...
Power Management Options (ACPI,APM) -->
CPU Frequency Scaling -->
# we will use the cpufreqd daemon, so do not handle it automatically
Default CPUFreq Governor (userspace) -->
CPU Frequency Table Helpers (if your driver doesn't show up)
And a driver ( I chose Intel Pentium 4 Clock Modulation)
Code: Select all
emerge cpufreqd
# if you will use the "human-readable" frequency reading,
emerge cpufrequtils
# this if you don't have it. It looks nice ;)
emerge torsmo
# Torsmo tells me all the temps and frequencies in this setup.
Code: Select all
# Remember to modify this with your own CPU frequencies (in Hz, check /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies for the HZ settings you
can use)
# Also, you need spaces between the sections like [Rule] [General] and [Profile] (they are already here in this example)
# This file was configured P4 2.80ghz (C version, Hyper-Threading, Northwood cor
e) on a desktop
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=1
pm_type=acpi #(acpi, apm or pmu)
# Uncomment the following line to enable ACPI workaround (see cpufreqd.conf(5))
# acpi_workaround=1
verbosity=3 #(if you want a minimal logging set to 5)
[Profile]
name=max_power
# These should be replaced with your own frequencies
minfreq=2100000
maxfreq=2800000
policy=userspace
[Profile]
name=medium_power
minfreq=1400000
maxfreq=1400000
policy=userspace
[Profile]
name=lo_power
minfreq=700000
maxfreq=1050000
policy=userspace
# for low power operations, use lo_power profile, since it will not need added pow
er. replace cpu_interval=0-40 with whatever CPU load you think should need only 700mhz-1000mhz (or whatever you chose) like cpu_interval=0-30.
[Rule]
name=lo_cpu_boost
ac=on
cpu_interval=0-40
profile=lo_power
# Something around the middle is happening, like the end of a portage sync or co
mpile; the CPU should be good in the 1.4ghz-1.75ghz range.
[Rule]
name=medium_cpu_boost
ac=on
cpu_interval=41-49
profile=medium_power
# Now the CPU needs some power, so give it full strength. This runs when you are doing something not listed in the last rule (which counts as more if the programs listed are running) is using a lot of cpu power
[Rule]
name=max_cpu_boost
ac=on
cpu_interval=50-100
profile=max_power
# various progs need full power, so give it to them, no matter what. These include movie players, and most things that run during a emerge. Modify this with programs that need power
[Rule]
name=power_needed
ac=on
# These programs, if running, will cause your CPU to go at 100% (in this case, 2.8ghz) remove any that you think should not cause this.
programs=xine,mplayer,gmplayer,avidemux,gcc,g++,emerge,cc,nbench,automake,config
ure,autoconfig,make
# CPU Interval = CPU Load
cpu_interval=0-100
profile=max_power
Now that that is done and over with, open three consoles. (or one, if you will run cpufreqd without a temperature reading or frequency reading (or do not need a script to do this)) One will run tailfreq, the other temps. The last one will run:
cpufreqd -D -f /etc/cpufreqd.conf -V 6
Now you will see tons of output. Keep an eye on whatever you use to see the frequencies, so you know what speed your CPU is running.
Congratulations, you are done!
Questions, Comments?
Of course, the tailfreq and temps script could be replaced with a torsmo or anything else you want to use ( I use torsmo)



