From owner-freebsd-current@FreeBSD.ORG Mon Apr 18 14:01:28 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 62BD016A4CE for ; Mon, 18 Apr 2005 14:01:28 +0000 (GMT) Received: from poup.poupinou.org (poup.poupinou.org [195.101.94.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9867443D5C for ; Mon, 18 Apr 2005 14:01:27 +0000 (GMT) (envelope-from ducrot@poupinou.org) Received: from ducrot by poup.poupinou.org with local (Exim) id 1DNWoP-00082N-00; Mon, 18 Apr 2005 16:01:17 +0200 Date: Mon, 18 Apr 2005 16:01:17 +0200 To: Poul-Henning Kamp Message-ID: <20050418140117.GH2298@poupinou.org> References: <4263A33A.3030201@centtech.com> <2304.1113826754@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2304.1113826754@critter.freebsd.dk> User-Agent: Mutt/1.5.6+20040907i From: Bruno Ducrot cc: freebsd-current@freebsd.org cc: Eric Anderson 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: Mon, 18 Apr 2005 14:01:28 -0000 On Mon, Apr 18, 2005 at 02:19:14PM +0200, Poul-Henning Kamp wrote: > In message <4263A33A.3030201@centtech.com>, Eric Anderson writes: > >Lukas Ertl wrote: > > > >There's been some discussion on the -mobile list (I believe) about > >this kind of thing before. I think powerd is currently running with > >a 'best shot' configuration, and I'm pretty sure that if anyone has > >a better algorithm in a patch form for people to try, I'm certain the > >good people with commit bits would easily commit a patched better version. > > I don't think a proportional approach will work in this case, the steps > are too far apart. > > I also think the switch to full speed is wrong. Such see-saw > algorithms waste far too much time decaying. A less steep flank > should be used. The full speed thing is right in almost case. When we ran the processor at lower speed, then we loose somehow the runpercent if running at full speed at previous window. Suppose for example we have those normalized performance states: 100% 66% 50% If we ran at 50% but read a 100% runpercent, then if we were running at full speed, we would got a 50% runpercent which is given by (runpercent * normalized_speed). Those far, we can only say actually that runpercent (at full speed) is in-between 50% and 100%. If, for example, the real runpercent (at full speed) is actually 50%, then we should stay at 50%, if its at 66%, we should set speed at 66% and so on. But we can only estimate a value of 50% in all cases. Therefore almost all algorithms will put the processor at full speed if an increase is detected. This work pretty well when the polling intervall is small (something between 40 or 50 milliseconds). In the case of powerd, the real trouble is maybe the polling interval and we should use an adaptive filter in order to fix this issue. The case when we detect to go down is less problematic because we are able to compute at least an accurate estimation of runpercent for the previous window. -- Bruno Ducrot -- Which is worse: ignorance or apathy? -- Don't know. Don't care.