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.noReceived on Fri Jan 18 2008 - 08:36:19 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:26 UTC