From owner-freebsd-current@FreeBSD.ORG Tue Apr 19 01:03:11 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F272316A4CE for ; Tue, 19 Apr 2005 01:03:10 +0000 (GMT) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2C6B43D31 for ; Tue, 19 Apr 2005 01:03:09 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.22] (andersonbox2.centtech.com [192.168.42.22]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id j3J1387E062299; Mon, 18 Apr 2005 20:03:08 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <426458A1.7010008@centtech.com> Date: Mon, 18 Apr 2005 20:02:25 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050325 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Daniel O'Connor" References: <20050418232944.271AD5D07@ptavv.es.net> <200504191026.55803.doconnor@gsoft.com.au> In-Reply-To: <200504191026.55803.doconnor@gsoft.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.82/839/Mon Apr 18 09:53:43 2005 on mh1.centtech.com X-Virus-Status: Clean cc: Poul-Henning Kamp cc: freebsd-current@freebsd.org Subject: Re: powerd(8) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2005 01:03:11 -0000 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. ------------------------------------------------------------------------