From owner-freebsd-current@FreeBSD.ORG Thu Jan 17 17:03:56 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410F316A41A for ; Thu, 17 Jan 2008 17:03:56 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA5A13C457 for ; Thu, 17 Jan 2008 17:03:55 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 26066 invoked from network); 17 Jan 2008 17:03:56 -0000 Received: from adsl-71-141-123-117.dsl.snfc21.pacbell.net (HELO ?192.168.1.77?) (nate-mail@71.141.123.117) by root.org with ESMTPA; 17 Jan 2008 17:03:56 -0000 Message-ID: <478F8A75.5010701@root.org> Date: Thu, 17 Jan 2008 09:03:49 -0800 From: Nate Lawson User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <478930D2.90806@digifonica.com> <200801171115.43663.doconnor@gsoft.com.au> <86myr4n4gp.fsf@ds4.des.no> In-Reply-To: <86myr4n4gp.fsf@ds4.des.no> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org, Maxim Sobolev , Igor Mozolevsky , Stefan Lambrev Subject: Re: powerd adaptive mode latching X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 17 Jan 2008 17:03:56 -0000 Dag-Erling Smørgrav wrote: > "Daniel O'Connor" writes: >> One problem with it is that it lags behind actual usage by a few >> seconds (presumably averaging it). > > It is based on the (didle/dt) / (dtotal/dt) fraction computed from > kern.cp_time, which can take a while to ramp up. This is not easily > seen in a cursory reading of the code, as the fraction is computed in a > very roundabout way. While providing more accurate information to powerd is a good goal, I want to preempt any requests to move the scheduling algorithm into the kernel. Until we're making multiple changes a second by necessity, there's no reason to have the scheduler there. Note that inefficiencies in the current scheduling algorithm (2x up, 1x down) are not a cause to make decisions more quickly. The path should be first fix the algorithm by profiling replacements, then improve the liveness of data provided to it. >> Turning the LCD off saves about 4W too. > > Hmm, it would be interesting to experiment with varying backlight > brightness based on system load :) I think xscreensaver could do some of this based on interactivity. It already can blank the screen with dpms. Macbooks slowly dim before blanking. I often have a bg job that uses a lot of cpu (buildkernel?) so using cpu load wouldn't be good. -- Nate