[Thinlinc-technical] negative 'rating' calculation in tl-best-winserver

Karl Mikaelsson derfian at cendio.se
Tue Aug 13 18:56:57 CEST 2013


Jens Langner <j.langner at hzdr.de> writes:
> The above is the information provided by Peter Astrand a while ago and
> by looking at it one could find the following line to be the reason
> for ending up with negative rating values:
>
> free_bogomips = EST_BOGOMIPS * (1 - loadinfo.loadavg)
>
> Here actually 'loadinfo.loadavg' is assumed to be between 0 and 1 for
> a system with not too high load. However, for multicore systems like
> the one above a normal, not too high load is always between 0 and the
> maximum number of cores. Thus, in our understanding the above equation
> should be changed to:
>
> free_bogomips = EST_BOGOMIPS * (numcores - loadinfo.loadavg) / numcores

Hi Jens,

You're correct, the loadavg number is between 0 and number of cpus
while it's being interpreted as being between 0 and 1. I would probably
rewrite your code as follows, but that's getting close to bikeshedding
territory.

> free_bogomips = EST_BOGOMIPS * (1 - (loadinfo.loadavg / loadinfo.num_cpus))

I've added a bug for this to make sure we don't forget about this.

https://www.cendio.com/bugzilla/show_bug.cgi?id=4768

regards,
Karl

-- 
Karl Mikaelsson         derfian at cendio.se
System Developer        +46 (0)13-290863
Cendio AB               http://facebook.com/ThinLinc
http://www.cendio.com/  http://twitter.com/ThinLinc



More information about the Thinlinc-technical mailing list