[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian on the Desktop - plans for Lenny?

On Fri, Aug 10, 2007 at 05:11:07AM +0100, Matthew Garrett wrote:
> Ben Hutchings <ben@decadent.org.uk> 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]...


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

... 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

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

Reply to: