powerd adaptive mode latching

Dag-Erling Smørgrav des at des.no
Fri Jan 18 01:36:19 PST 2008


Nate Lawson <nate at root.org> writes:
> Dag-Erling Smørgrav <des at 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
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-current mailing list