You are here

Milestone overclocking - conservative governor

link: milestone-overclock

If you want to use the CPUfreq "conservative" governor as an alternative to the default "ondemand" governor, attached is the compiled kernel module (from Motorola sources).

From the kernel documentation:
The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour is more suitable in a battery powered environment.

After insmod, you can use:
echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

If you want to change the sampling rate (to have a faster response to the load change), you can use:
echo 125000 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate
125000µs is the lowest possible value.
(For some reason, SetCPU won't set and keep any lower value than the default 250000µs for the conservative governor unless you use the echo command above.)

My settings in mot_boot_mode (for those interested):
insmod /system/lib/modules/overclock12.ko
echo 56 > /proc/overclock/max_vsel
echo 1000000 > /proc/overclock/max_rate
echo "1 750000" > /proc/overclock/freq_table
echo "4 750000000 42" > /proc/overclock/mpu_opps
echo "2 500000" > /proc/overclock/freq_table
echo "3 500000000 30" > /proc/overclock/mpu_opps
echo "3 250000" > /proc/overclock/freq_table
echo "2 250000000 22" > /proc/overclock/mpu_opps
insmod /system/lib/modules/cpufreq_conservative.ko
echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 125000 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate

So my freq_table (cat /proc/overclock/freq_table) looks like this:
freq_table[0] index=0 frequency=1000000
freq_table[1] index=1 frequency=750000
freq_table[2] index=2 frequency=500000
freq_table[3] index=3 frequency=250000

And my mpu_ops table (cat /proc/overclock/mpu_opps):
mpu_opps[5] rate=1000000000 opp_id=5 vsel=56
mpu_opps[4] rate=750000000 opp_id=4 vsel=42
mpu_opps[3] rate=500000000 opp_id=3 vsel=30
mpu_opps[2] rate=250000000 opp_id=2 vsel=22
mpu_opps[1] rate=125000000 opp_id=1 vsel=32
/*unused*/

My CPU scales nicely between 250/500/750/1000 Mhz as can be seen from cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq and the CPU is undervolted on all but the highest frequency.

Beware that your CPU may not be stable at such low voltages as mine, you might need to set the vsel values higher in your case (e.g. echo 60 > /proc/overclock/max_vsel and echo "4 750000000 50" > /proc/overclock/mpu_opps etc.). Please, test your settings before you put them in your mot_boot_mode script permanently.