From: "Stephan Bärwolf" <stephan.baerwolf@tu-ilmenau.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>,
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 19:35:56 +0200 [thread overview]
Message-ID: <4DCAC8FC.5060505@tu-ilmenau.de> (raw)
In-Reply-To: <1305132185.2914.251.camel@laptop>
>I think what we wanted to do was minimize the error:
> err = weight - inv*WMULT_CONST
Hi all,
thanks for your fast response.
I think what you mean is:
err = | WMULT_CONST - inv*weight | --> min
right?
But the following table(s) shows the difference in the inverses:
(assuming WMULT_CONST = 2**32 as on x64)
weight oldway
inv_weigth new inv_weight
1 2147483649 (=1+2**31)
4294967295 [=(2**32)-1]
2
1431655766 2147483647
3 (= WEIGHT_IDLEPRIO) 1073741824 1431655765
15 (= nice 19)
268435456 286331153
1024 (=nice 0)
4190212 4194304
...
...
88761 (=nice -20)
48387 48388
----
weight err
oldway err newway
1 2147483647 (=2**31 - 1)
1
2 1431655764
2
3 (= WEIGHT_IDLEPRIO) 1073741824 1
15 (= nice 19) 268435456 1
1024 (=nice 0)
4190208 0
...
...
88761 (=nice -20) 88789
28
Thus the "err" of the old way can become very large (up to about 2^31 ).
And of course the new error increases with increasing weight, it is
still alway
smaller than the oldway err (because oldway inv converts to newway inv)...
regards Stephan
--
Dipl.-Inf. Stephan Bärwolf
Ilmenau University of Technology, Integrated Communication Systems Group
Phone: +49 (0)3677 69 2821, FAX: +49 (0)3677 69 1614
Email: stephan.baerwolf@tu-ilmenau.de,
Web: http://www.tu-ilmenau.de/iks
next prev parent reply other threads:[~2011-05-11 17:24 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
2011-05-11 17:35 ` Stephan Bärwolf [this message]
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=4DCAC8FC.5060505@tu-ilmenau.de \
--to=stephan.baerwolf@tu-ilmenau.de \
--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=peterz@infradead.org \
--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