powerd(8)
Eric Anderson
anderson at centtech.com
Mon Apr 18 18:03:11 PDT 2005
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/.+\: //;
@vals = split/\s+/,$sysctl;
$lastenergy = 0;
foreach $val (@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.
------------------------------------------------------------------------
More information about the freebsd-current
mailing list