WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: AW: [Xen-devel] Question on Credit accounting in Credit Scheduler

To: Heiko Wundram <modelnine@xxxxxxxxxxxxx>, Tim.Deegan@xxxxxxxxxx
Subject: Re: AW: [Xen-devel] Question on Credit accounting in Credit Scheduler
From: Thomas Pfeuffer <thomas.pfeuffer@xxxxxxxx>
Date: Fri, 30 Jul 2010 08:25:24 +0200
Cc: dunlapg@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 29 Jul 2010 23:26:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <014c01cb2f23$9733b420$c59b1c60$@org>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1280409687.8054.18.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <014c01cb2f23$9733b420$c59b1c60$@org>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050603 Fedora/1.7.8-1.1.1.legacy
Hello,

thanks for your answer.

Best regards,

Thomas


Heiko Wundram wrote:
-----Ursprüngliche Nachricht-----
Von: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-
bounces@xxxxxxxxxxxxxxxxxxx] Im Auftrag von Thomas Pfeuffer
Gesendet: Donnerstag, 29. Juli 2010 15:21
An: xen-devel@xxxxxxxxxxxxxxxxxxx
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.


  

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>