Re: powerd(8)

From: Eric Anderson <anderson_at_centtech.com>
Date: Mon, 18 Apr 2005 20:02:25 -0500
Daniel O'Connor wrote:
> On Tue, 19 Apr 2005 08:59, Kevin Oberman wrote:
> 
>>I also have found that changing the polling interval to 150 is an
>>improvement. Half a second is just too long, IMHO. I also discovered
>>that with my system (P4M) that some settings can use substantially more
>>power than faster settings, so I have kludged an ugly hack to avoid
>>those settings. These changes make a significant difference in power
>>consumption.
> 
> 
> Can you elaborate on these?
> It may be worth adding a general algorithm to cull the frequency list powerd 
> uses based on this info.
> 

Here's a quick perl script that does what I think he was doing.  The lines that 
have "skipping" in it are inefficient.  (sorry for the ugly perl)

#!/usr/local/bin/perl

$sysctl = `sysctl dev.cpu.0.freq_levels`;
$sysctl =~ s/.+\: //;
_at_vals = split/\s+/,$sysctl;
$lastenergy = 0;

foreach $val (_at_vals) {
   ($mhz, $energy) = split/\//,$val;
   $energypermhz = $energy/$mhz;
   $energypermhz = sprintf ("%0.3f", $energypermhz);
   if ($lastenergy == 0) { $lastenergy = $energy; }
   if ($energy > $lastenergy) {
     print "skipping $energypermhz -> $mhz - $energy\n";
   } else {
     print "$energypermhz -> $mhz - $energy\n";
     $lastenergy = $energy;
   }
}


-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
A lost ounce of gold may be found, a lost moment of time never.
------------------------------------------------------------------------
Received on Mon Apr 18 2005 - 23:03:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:32 UTC