The DM1z, Arch Linux, cpufrequtils, cpufreq-set, and proof that I am extremely lazy.
Setting up powersaving on a laptop can be a chore. If you’re like me, you’ll probably just ignore everything else (suspend, hibernate, standby, lid thingies, hard drive spindowns, etc) except CPU frequency scaling. This laptop wouldn’t even attempt to shut down on its own when the battery level is extremely low. A few days back I ran out of juice while playing Chrono Trigger for 3+ hours straight.
3 hours. On a netbook. While emulating a SNES game. Unacceptable battery life for a netbook, right?
I did a little tinkering, and found out that my frequency scaling setup many months ago was a fluke. Loading the cpufreq_ondemand module wasn’t enough, as the output of cpufreq-info still showed that the scaling governor I was using was still at performance. I fixed it by not setting the governor this way anymore and do it by starting the cpufreq daemon at boot. I set my default governor to ondemand by simply editing a few lines at /etc/conf.d/cpufreq.
I didn’t stop there. I created 2 scripts which modify the maximum and minimum frequencies so I could easily switch between my “profiles”. I did this with cpufreq-set.
Script that I named powersave.sh:
cpufreq-set -c 1 -g ondemand -u 800Mhz -d 800Mhz
cpufreq-set -c 0 -g ondemand -u 800Mhz -d 800Mhz
Script that I named notpowersave.sh:
cpufreq-set -c 1 -g ondemand -u 1.60GHz -d 800MHz
cpufreq-set -c 0 -g ondemand -u 1.60GHz -d 800MHz