lkml.org 
[lkml]   [2011]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] sched: fix/optimise calculation of weight-inverse
    From
    Date
    On Wed, 2011-05-11 at 18:20 +0200, Ingo Molnar wrote:
    > > - lw->inv_weight = 1 + (WMULT_CONST-lw->weight/2)
    > > - / (lw->weight+1);
    > > + lw->inv_weight = WMULT_CONST / lw->weight;
    >
    > hm, i definitely think there was a rounding reason for that - but apparently
    > i'm an idiot who does not add comments to non-obvious code! :-)

    I suspect I might be the idiot,

    > Peter, do you remember this?

    I think what we wanted to do was minimize the error:
    err = weight - inv*WMULT_CONST

    by adding another term. But we could well have simply made a mess of it
    instead.



    \
     
     \ /
      Last update: 2011-05-11 18:43    [W:0.031 / U:0.268 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site