[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1305132185.2914.251.camel@laptop>
Date: Wed, 11 May 2011 18:43:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: Stephan Bärwolf
<stephan.baerwolf@...ilmenau.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Nikhil Rao <ncrao@...gle.com>, Mike Galbraith <efault@....de>,
"Nikunj A. Dadhania" <nikunj@...ux.vnet.ibm.com>,
Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: fix/optimise calculation of weight-inverse
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists