Dynamic CPU throttling

My ThinkPad has a Centrino chipset which means, among other things, among other things, among other things, that the CPU can be scaled back when it's under light load. This works well when I'm on batteries it sits on 600MHz, and if needed it steps up to 1.5GHz. When I'm on AC power though I want it running at max-speed. There is a BIOS setting that is meant to enforce these rules though either it doesn't work or the Linux kernel/userland tools pay no attention to it.

As a fix, I use these modified scripts to start and stop powernod when I'm on batteries or AC.

3 Comments so far

  1. Lanzon on July 19th, 2005

    “Among Other Things” I feel an extra head having its say!

  2. Davyd on July 19th, 2005

    You may like to look at ‘cpufreqd’ which has fully configurable rules for a number of situations.

    For what it’s worth, after some experimentation on the topic, it seems more useful to keep the CPU clock low while on AC. Your machine gets less hot and charges faster as a result of driving less current into that poor CPU.

    You may also like to look at playing with your governer. If you find powernowd to not be suitable for you, try using the ondemand governer and doing something similar in userspace.

  3. mlambie on July 19th, 2005

    Lanzon: I’m glad someone recognized the reference. For those that don’t, we had a lecturer at uni who would say “among other things” instead of “umm…” He also had a massive growth on his neck which we thought was a second head.

    Davyd: This really was a simpe hack with simple requirements. What I’ll end up doing is letting powernowd run the show when I finish this project. I’m doing some development on the laptop and Apache would wait 2-4 seconds before responding with a reply. The PHP code wasn’t intensive, it just had to wait for the CPU to crank up which annoyed me.

    Thanks for the tips though - much appreciated.