From: "Heiko Wundram" <modelnine@modelnine.org>
To: 'Thomas Pfeuffer' <thomas.pfeuffer@mytum.de>,
xen-devel@lists.xensource.com
Subject: AW: Question on Credit accounting in Credit Scheduler
Date: Thu, 29 Jul 2010 15:40:20 +0200 [thread overview]
Message-ID: <014c01cb2f23$9733b420$c59b1c60$@org> (raw)
In-Reply-To: <1280409687.8054.18.camel@bmwve02.lpr.e-technik.tu-muenchen.de>
> -----Ursprüngliche Nachricht-----
> Von: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-
> bounces@lists.xensource.com] Im Auftrag von Thomas Pfeuffer
> Gesendet: Donnerstag, 29. Juli 2010 15:21
> An: xen-devel@lists.xensource.com
> Betreff: [Xen-devel] Question on Credit accounting in Credit Scheduler
>
> I have looked through the source code of Credit Scheduler.
>
> In csched_acct(), the number of credits a domain gets (i.e
> credit_fair),
> is calculated as follows:
>
> credit_fair = ( ( credit_total * sdom->weight) + ( weight_total -
> 1)
> ) / weigth_total
>
> But I would expect, that the Credits are calculated by
>
> credit_fair = (credit_total * sdom->weight) / weigth_total
>
> Does anybody know, what function the term (weight_total -1) has?
Without knowing details of the Xen scheduling algorithm (i.e., I'm guessing
that the above is integer-only math), all it does is "round up" the (fair)
credits a domain gets [(x+y-1)/y means division with always rounding up,
think of the "Gaußklammer", don't know the german name, in reverse];
basically, if the above calculation is done for all domains, the respective
sum of all calculated credit_fair will always be equal to or higher than
credit_total, which wouldn't be the case (because of truncation when just
doing x/y) when using your function, i.e. the sum of all credit_fair might
be less than credit_total.
For a scheduling algorithm, you'll want to always give away _at least_ all
available credits, and this is a simple enough method to do just that
without resorting to floating point calculations.
--- Heiko.
next prev parent reply other threads:[~2010-07-29 13:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 13:21 Question on Credit accounting in Credit Scheduler Thomas Pfeuffer
2010-07-29 13:35 ` Tim Deegan
2010-07-29 13:42 ` George Dunlap
2010-07-29 13:40 ` Heiko Wundram [this message]
2010-07-30 6:25 ` AW: " Thomas Pfeuffer
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='014c01cb2f23$9733b420$c59b1c60$@org' \
--to=modelnine@modelnine.org \
--cc=thomas.pfeuffer@mytum.de \
--cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.