From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Stephan Bärwolf" <stephan.baerwolf@tu-ilmenau.de>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Nikhil Rao" <ncrao@google.com>, "Mike Galbraith" <efault@gmx.de>,
"Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>,
"Srivatsa Vaddagiri" <vatsa@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: fix/optimise calculation of weight-inverse
Date: Wed, 11 May 2011 18:43:05 +0200 [thread overview]
Message-ID: <1305132185.2914.251.camel@laptop> (raw)
In-Reply-To: <20110511162030.GA2638@elte.hu>
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.
next prev parent reply other threads:[~2011-05-11 16:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 16:03 [PATCH] sched: fix/optimise calculation of weight-inverse Stephan Bärwolf
2011-05-11 16:20 ` Ingo Molnar
2011-05-11 16:43 ` Peter Zijlstra [this message]
2011-05-11 17:35 ` Stephan Bärwolf
2011-05-11 19:49 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305132185.2914.251.camel@laptop \
--to=peterz@infradead.org \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=ncrao@google.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=stephan.baerwolf@tu-ilmenau.de \
--cc=torvalds@linux-foundation.org \
--cc=vatsa@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox