AMD cpu slows down (I think)

Jonathan Berry berryja at gmail.com
Mon Nov 1 00:46:02 UTC 2004


On Sun, 31 Oct 2004 02:30:13 -0300, Trevor Smith <trevor at haligonian.com> wrote:
> On October 31, 2004 1:38 am, Jonathan Berry wrote:
> > Yeah, you have to create a script, put it in /etc/init.d/ and run a
> > couple of commands to get it to start on boot.  I'd give you more
> > details, but I'm in Windows at the moment.  I'll send you mine that I
> > made up, if you want it, next time I go back to the Light Side : ).
> 
> I just might be interested in that. The cpuspeed daemon was running but I've
> since told it to get bent since all it ever seemed to do was throttle my cpu
> to a stupidly low speed.

See below.  I changed the "modprobe powernow-k8" line to "...-k7", but
I don't think this line is necessary.  You can put the script in a
file called powernow (or whatever you want), make sure it is
executable, and put it in /etc/init.d/  Then run:
chkconfig --add powernow
chkconfig --level 2345 powernow on
and if I'm remembering correctly, you should be set.  Of course, do
all as root.  Just don't call the script powernowd, as this causes
problems with the "killall powernowd" statements in the script; it
took me a while to figure that one out... : )  Notice that I've added
the option -p 100, which causes it to poll every 100 ms instead of the
default every second.  Seems to bump the frequency up much more
quickly and not take up any more cpu power.

> > In the mean time, you can start it manually as root.  I think it may
> 
> Right. I did and things seem to be finally working as they should. Speed drops
> to cpu MHz         : 530.048 but when I try to do any work, things jump up
> temporarily to cpu MHz         : 2120.194.

Yep, this is what it should do.  Very good.

> Things do become a bit sluggish again when I disconnect the AC power but I
> suppose I can figure out how to adjust that. It just seems to be throttling
> back too much.

Strange.  powernowd should not change characteristics.  Do any of your
files in the sysfs folder (/sys/devices/system/cpu/cpu0/cpufreq/)
change when going to/from AC power?  You mentioned that graphics
seemed sluggish.  Perhaps you video card has a power save mode.  I
know mine does (nVidia 440 Go) at least in Windows.  You can set it to
three different performance levels for running on battery or on power.
 I don't know if these are configurable in Linux, though.  Do you know
of anything like this for your g-card?

> Regardless, these are the 2 benefits to this endeavour:
> 
> 1. I've found out how to prevent the infuriating slowdowns, if I really want
> to
> 
> 2. I've found that my laptop was NEVER running at 2 GHz, as advertised, and
> the difference speeds of screen draws and some simple tasks is already
> immediately noticeable.

Amazing how good those AMD cpus can be, even at slow speeds : ).  My
64 still clips along even if I leave it at the low 800 MHz.  And they
just rock at top speed.

> Thanks!

No problem.
Jonathan

----------- Begin powernow ---------------
#! /bin/bash
#
#  chkconfig: 2345 5 95
#  description: CPU frequency scaling daemon
#
# This is a simple example script to show how one could control powernowd
# with one simple command.  it could be adapted to be used as an init script.
#
# It unserstands "stop", "start", "restart", and these other commands:
#       "dyn"   turn on dynamic control (alias to start, aka, run the daemon)
#       "high"  kill daemon, set cpu to high speed.
#       "low"   kill daemon, set cpu to low speed.
#
 
OPTIONS="-p 100"
 
if [ "$1" = "start" -o "$1" = "restart" -o "$1" = "dyn" ]; then
        killall -15 powernowd >& /dev/null
        modprobe powernow-k7
        /usr/sbin/powernowd $OPTIONS
        exit
fi
 
if [ "$1" = "stop" ]; then
        killall -15 powernowd >& /dev/null
        exit
fi
 
if [ "$1" = "high" -o "$1" = "low" ]; then
        killall -15 powernowd >& /dev/null
        for i in `/bin/ls /sys/devices/system/cpu/`; do
                pushd . >& /dev/null
                cd /sys/devices/system/cpu/$i/cpufreq
                if [ "$1" = "low" ]; then
                        cat scaling_min_freq > scaling_setspeed
                else
                        cat scaling_max_freq > scaling_setspeed
                fi
                popd >& /dev/null
        done
        exit
fi
 
echo "Unrecognised option \"$1\""
exit

----------- End powernow ---------------




More information about the users mailing list