Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jan 2008 10:36:09 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Nate Lawson <nate@root.org>
Cc:        freebsd-current@freebsd.org, Maxim Sobolev <sobomax@digifonica.com>, Igor Mozolevsky <igor@hybrid-lab.co.uk>, Stefan Lambrev <stefan.lambrev@moneybookers.com>
Subject:   Re: powerd adaptive mode latching
Message-ID:  <86y7aneara.fsf@ds4.des.no>
In-Reply-To: <478F8A75.5010701@root.org> (Nate Lawson's message of "Thu\, 17 Jan 2008 09\:03\:49 -0800")
References:  <a2b6592c0801110351l382959ffh1d55f2bcd2e6ca1b@mail.gmail.com> <a2b6592c0801111119r148d3697hf75a59b7bf74d540@mail.gmail.com> <478930D2.90806@digifonica.com> <200801171115.43663.doconnor@gsoft.com.au> <86myr4n4gp.fsf@ds4.des.no> <478F8A75.5010701@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Lawson <nate@root.org> writes:
> Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > [powerd's load calculation] 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.

Never struck my mind.  Policy belongs in userland.  However, the load
calculations could benefit from a (semantically identical) rewrite, if
only to make them more easily understandable to the reader.  I would
rename a couple of variables to make it clear that they are derivatives,
compute the fraction explicitly, and use an internal representation of
the threshold that places it in [0..1] instead of [0..100], allowing a
direct comparison.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y7aneara.fsf>