Our Very Existence

Random. And incoherent.

The DM1z, Arch Linux, cpufrequtils, cpufreq-set, and proof that I am extremely lazy.

with 4 comments

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:
#!/bin/bash
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:
#!/bin/bash
cpufreq-set -c 1 -g ondemand -u 1.60GHz -d 800MHz
cpufreq-set -c 0 -g ondemand -u 1.60GHz -d 800MHz

Woohoo. Running this laptop 99% of the time while watching movies at 800MHz ((((:Censoring username and hostname because reasons

Advertisements

Written by kpbotbot

March 13, 2012 at 10:01 am

4 Responses

Subscribe to comments with RSS.

  1. […] EDIT: Found a “better” way to set this up. Check here. […]

  2. Hi there, have a look at laptop-mode tools

    It’s all in the Arch wiki 🙂

    AgentOss

    April 9, 2012 at 9:29 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: