Managing CPU throttling

Noah Dain noahdain at gmail.com
Tue Nov 9 05:59:48 UTC 2004


for us laptop users using powernowd, I hacked up this script to start
and/or stop powernowd via apmd(proxy) depending whether running on
line-power or battery.  apmd detects the changes in power state, and
runs this script.  ( acpi is broken enough on my thinkpad that i use
apm, and it works fully, even hibernate/suspend to disk, thus apm only
for the moment )

there's also the boot-state to consider.  powernowd is started by the
init scrips by default.  I've not tested this out yet.  Maybe tomorrow
and acpi support if I'm sufficiently bored at work ;-)

drop this file into /etc/apm/event.d/, chmod +x it, yank the power and
see what happens.

-- cut here --

#!/bin/sh
#
# desc: apmd hook script for powernowd adapted from apmiser
# file: /etc/apm/event.d/powernowd

case "$1,$2" in

    stop,*|suspend,*)
        /etc/init.d/powernowd stop
        exit 0
        ;;

    start,*|change,power|resume,suspend)
        : # Continue below
        ;;
    *)
        exit 0
        ;;
esac

on_ac_power 2> /dev/null
case "$?" in

    0) # We are on line power
        /etc/init.d/powernowd stop
        ;;

    1) # We are on battery power
        /etc/init.d/powernowd start
        ;;
    #*) # We don't know what kind of power we are on
                # Don't change anything
esac

-- end cut --

-noah

On Mon, 8 Nov 2004 17:25:05 -0600, brschmid <ulist at gs1.ubuntuforums.org> wrote:
> 
> janne Wrote:
> > sön 2004-11-07 klockan 12:31 -0600 skrev brschmid:
> 
> 
> > > i am dissapointed as well, because i want my laptop at full speed
> > when
> > > plugged in, and scaled back when on battery.
> > >
> > > powernowd scales back all the time.
> >
> > It also scales up immediately.
> >
> > I tend to use my laptop for a mixture of things, cpu-wise; sometimes I
> > need very little power (reading mail, surfing, writing text or coding),
> > punctuated by neding all there is (compiling, doing a simulation run).
> > I
> > have never had any problem with powernowd. As soon as I start something
> > cpu-intensive, it kicks the clock into high gear immediately, and stays
> > there. Once it finishes, it gradually ramps down to the lowest setting
> > again. And it does the same when on battery power. Perfect. Never have
> > I
> > felt the kind of slowness or tardiness that I got from using cpufreqd.
> >
> > In fact, my only annoyance is that my 2-cpu desktop does not support
> > power throttling; it would be absolutely wonderful not to have it
> > emulating a noisy hair dryer next to my table when I'm not actually
> > running any simulations on it.
> >
> >
> >
> > --
> > Trust the Computer. The Computer is your friend.
> > 
> > Tel. (Japan) 090-3622 8920            Dr. Jan Morén (mr)
> > Dept. of Cognitive Science
> > http://lucs.lu.se/people/jan.moren    Lund, Sweden
> >
> >
> > --
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> ok, that is fine but powernowd doesn't go full power when i am running
> Folding at Home, which i do all the time, and folding at 600mhz takes
> forever compared to 1.4Ghz, trust me.
> 
> --
> brschmid
> 
> 
> 
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list