I'm trying to find info on my laptop problem but can't find anything really explanatory. I assume it's something to do with CPU speed auto-setting on battery power and your site seems to be relevant.
My situation: I have a Compaq Presario 2197CA, AMD Athlon XP-M 2800+ CPU. With Fedora Core 1, no problems on AC or battery power. After upgrade to FC2 with kernel-2.6.5-1.358, originally no problem (I don't recall). But at some point I updated the kernel to kernel-2.6.8-1.521 and possibly then, possibly because of some other "upgrade" my computer slips into a different mode when on battery power.
In this "mode" it becomes extremely, irritatingly slow to use. A command shell takes visible time to scroll/update. GUI windows take maddening seconds to draw, etc.
Research leads me to believe that this is a "feature" of the Powernowstuff or something, but it is definitely not a feature I want.
A found a web site (http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml) that says:
"This meant that until version 2.6.6 of the kernel, Powernow was non functional on these laptops." and "Compaq Presario 2100. Has 14 PST tables. None of which match the cpuid of the processor (0x7A0)"
I conclude that this means that my original FC1 and FC2 kernels (pre-2.6.6) would have had disfunctional support for Powernow but that my new kernel has "fixed" support for this. And this, I assume, is the source of my problem.
However, I can find no docs about how to control Powernow or, better yet, turn it off (I use my laptop at school and home and I rarely use battery power so it's not an issue for me).
After my long ramble, 4 questions:
1. am I correct in my assessment of the situation, do you think? 2. how could anybody want to use a system that is struggling to update windows and such, no matter how much longer it made their batteries last? 3. is my problem more likely the result of poor/nonexistent graphics acceleration which causes the CPU to do graphics work as well as system work, thus when the CPU is slowed down, graphics slow down? 4. how can I turn this damn Powernow thing off?
Thanks in advance.
On Sat, 30 Oct 2004, Trevor Smith wrote:
Research leads me to believe that this is a "feature" of the Powernowstuff or something, but it is definitely not a feature I want.
<snip>
- am I correct in my assessment of the situation, do you think?
cat /proc/cpuinfo - and see if the CPU MHz is not the max it should be.
- how can I turn this damn Powernow thing off?
You can try: 'killall -SIGUSR1 cpuspeed' and see if to goes to max speed (/proc/cpuinfo) - and you get all your performance back.
You can also disable it by turning off 'cpuspeed' service.
I like using sppedstep on FC1.(go to max-freq only if you need the extra cycles). I don't have any x-window refresh issues.
Satish
Hi Trevor,
On Sat, 30 Oct 2004 13:18:47 -0300, Trevor Smith trevor@haligonian.com wrote:
My situation: I have a Compaq Presario 2197CA, AMD Athlon XP-M 2800+ CPU. With Fedora Core 1, no problems on AC or battery power. After upgrade to FC2 with kernel-2.6.5-1.358, originally no problem (I don't recall). But at some point I updated the kernel to kernel-2.6.8-1.521 and possibly then, possibly because of some other "upgrade" my computer slips into a different mode when on battery power.
I have a Compaq R3000Z with an Athlon64 that is very similar to your R2197. You might look at the archives of the LinuxR3000 mailing list: http://quanta.homeip.net/mailman/listinfo/linuxr3000 While not directly applicable, there is some discussion about frequency scaling with the k8 driver. I'm using the k8 driver with powernowd, and frequency scaling works great.
[snip]
After my long ramble, 4 questions:
- am I correct in my assessment of the situation, do you think?
Not sure, but probably on the right track. Look at the files in /sys/devices/system/cpu/cpu0/cpufreq/ Specifically cat the files scaling_available_frequencies and scaling_governor to see what frequencies you can run and what governor you are running. I know if I boot up on battery power, my laptop cuts off the highest frequency setting. Also, check that you are running cpufreqd or powernowd or something of the like. If you are using one of these, you scaling_governor should read "userspace" to use them.
- how could anybody want to use a system that is struggling to update windows
and such, no matter how much longer it made their batteries last?
Certainly the performance you are describing is not good. With scaling, your processor should idle at a lower speed and then increase speed when it needs to do work. This prolongs battery life and saves power and heat as your processor can relax when it isn't doing anything useful.
- is my problem more likely the result of poor/nonexistent graphics
acceleration which causes the CPU to do graphics work as well as system work, thus when the CPU is slowed down, graphics slow down?
This could be true.
- how can I turn this d*** Powernow thing off?
If you really want to turn it off, you can do this as root: echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor This will cause you cpu to always run at the highest available frequency. Now, this frequency could be lower if you are on battery, which is what I see on my laptop. The best thing is to use a governor. Powernowd is pretty good, and it's simple. You can get it from http://www.deater.net/john/powernowd.html Do some looking around in /sys/devices/system/cpu/cpu0/cpufreq/ and report back what you find.
Jonathan
On October 30, 2004 1:35 pm, Satish Balay wrote:
cat /proc/cpuinfo - and see if the CPU MHz is not the max it should be.
Whoa. Good to know. It was way slow, even WITH my power cord plugged in.
- how can I turn this damn Powernow thing off?
You can try: 'killall -SIGUSR1 cpuspeed' and see if to goes to max speed (/proc/cpuinfo) - and you get all your performance back.
Yep, this did make things report as being faster:
model name : mobile AMD Athlon(tm) XP2800+ stepping : 0 cpu MHz : 2120.092
(previously it was 5hundredsomething). I don't notice any difference WITH the power cord in, but when I take it out, the computer remains usable. Strangely, screen drawing is still noticably different with the power cord unplugged, but it is well within tolerable limits now.
I like using sppedstep on FC1.(go to max-freq only if you need the extra cycles). I don't have any x-window refresh issues.
OK, where can I find this speedstep?
On Sat, 30 Oct 2004, Trevor Smith wrote:
On October 30, 2004 1:35 pm, Satish Balay wrote:
cat /proc/cpuinfo - and see if the CPU MHz is not the max it should be.
Whoa. Good to know. It was way slow, even WITH my power cord plugged in.
- how can I turn this damn Powernow thing off?
You can try: 'killall -SIGUSR1 cpuspeed' and see if to goes to max speed (/proc/cpuinfo) - and you get all your performance back.
Yep, this did make things report as being faster:
model name : mobile AMD Athlon(tm) XP2800+ stepping : 0 cpu MHz : 2120.092
(previously it was 5hundredsomething). I don't notice any difference WITH the power cord in, but when I take it out, the computer remains usable. Strangely, screen drawing is still noticably different with the power cord unplugged, but it is well within tolerable limits now.
I like using sppedstep on FC1.(go to max-freq only if you need the extra cycles). I don't have any x-window refresh issues.
OK, where can I find this speedstep?
speedstep is intel's cpuscaling similar to AMD's Powernow. I have a Pentium-M.
You might want to check '/usr/sbin/speedstep -h'. Perhaps use the following in /etc/cpuspeed.conf
OPTS="-i 1"
Satish
On October 30, 2004 2:25 pm, Jonathan Berry wrote:
The best thing is to use a governor. Powernowd is pretty good, and it's simple. You can get it from http://www.deater.net/john/powernowd.html Do some looking around in /sys/devices/system/cpu/cpu0/cpufreq/ and report back what you find.
Hmm... I downloaded and did make, make install, but I'm not sure what next. powernowd does not appear in my services utility so I can't set it to start or not on boot, nor does it appear to be running.
It says, "This means that you -need- to be running Linux v2.5 or later that includes the sysfs interface." I am running kernel-2.6.8-1.521 but I don't think I have the sysfs interface.
Sat, 30 Oct 2004 23:38:38 -0300, Trevor Smith trevor@haligonian.com wrote:
On October 30, 2004 2:25 pm, Jonathan Berry wrote:
The best thing is to use a governor. Powernowd is pretty good, and it's simple. You can get it from http://www.deater.net/john/powernowd.html Do some looking around in /sys/devices/system/cpu/cpu0/cpufreq/ and report back what you find.
Hmm... I downloaded and did make, make install, but I'm not sure what next. powernowd does not appear in my services utility so I can't set it to start or not on boot, nor does it appear to be running.
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 : ). In the mean time, you can start it manually as root. I think it may have come with an init script, but you need to add some comments to it to use chkconfig and have it start at boot. Look at some other scripts in /etc/init.d/ and edit the one that came with powernowd. The comments should be pretty obvious. Something like # chkconfig 2345 5 95 where the last two numbers indicate when it will start and stop in the boot and shutdown sequence. You want this to start early, stop late.
It says, "This means that you -need- to be running Linux v2.5 or later that includes the sysfs interface." I am running kernel-2.6.8-1.521 but I don't think I have the sysfs interface.
If you have the /sys/devices/system/cpu/cpu0/cpufreq/ directory and all the files in it, then yes, you do have the sysfs interface. It should be there on the Fedora kernels, at least as a module. I custom compiled my kernel so I don't remember exactly; I need psmouse as a module and wanted ntfs support (before I realized that you could download the module).
If the afore mentioned cpuspeed command (from Satish) worked, then you must be running the cpuspeed daemon, which does the same thing. I'm not sure how to configure that one, but you should be able to get it to do the frequency scaling as well.
Jonathan
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.
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.
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.
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.
Thanks!
If you have the /sys/devices/system/cpu/cpu0/cpufreq/ directory and all the files in it, then yes, you do have the sysfs interface. It
I've got them.
If the afore mentioned cpuspeed command (from Satish) worked, then you must be running the cpuspeed daemon, which does the same thing. I'm not sure how to configure that one, but you should be able to get it to do the frequency scaling as well.
I may look for a howto
On Sun, 31 Oct 2004 02:30:13 -0300, Trevor Smith trevor@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:
- I've found out how to prevent the infuriating slowdowns, if I really want
to
- 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 ---------------