On Fri, Aug 10, 2007 at 05:11:07AM +0100, Matthew Garrett wrote:
> Ben Hutchings <[EMAIL PROTECTED]> wrote:
> > This means that when draining the battery we do not allow the CPU to run
> > at full speed, so CPU-bound tasks take longer.  This tends to extend
> > battery life but reduces the processing work derived from the battery,
> > since other components then take a higher share of power.  And when
> > running on AC, we just waste power, though with a slight performance
> > gain.
> 
> If you're using the computer at all, it's not even likely to increase 
> battery life. A CPU at 600MHz and in C0 will draw significantly more 
> power than a CPU at 1.2GHz but in C4. It's more important to finish 
> whatever the CPU is doing quickly than it is to keep it at a low speed.

Except that a PowerPC processor (as found in Gustavo's ibook) simply
doesn't *have* C states. On my PowerBook G4, I noticed that when I
started running this crude hack[0]...

------
#!/bin/bash

modprobe cpufreq_userspace
echo $$ > /var/run/mycpufreqd
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
while true
do
        if expr $(uptime|cut -d',' -f3|cut -d':' -f2) '>' 0.75 > /dev/null
        then
                echo 1333333 > 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
        else
                if expr $(uptime | cut -d',' -f4) '<' 0.75 > /dev/null
                then
                        echo 666666 > 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
                fi
        fi
        sleep 10
done
------

... battery life would double[1]. A PowerPC running at its full
speed produces a *lot* more heat, which it needs to get rid of. When I
run the above script, my PowerBook is capable of running with its fan
shut off when idle, but not when running at high speed with a busy
CPU...

Moral: power management is an architecture-specific business.

[0] Yes, I should probably patch it to use /proc/loadavg rather than
    uptime. Whatever.
[1] Approximately, that is. Not like I used a timer or anything.

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to