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

[Xen-devel] Question on Credit accounting in Credit Scheduler

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Question on Credit accounting in Credit Scheduler
From: Thomas Pfeuffer <thomas.pfeuffer@xxxxxxxx>
Date: Thu, 29 Jul 2010 15:21:27 +0200
Delivery-date: Thu, 29 Jul 2010 06:27:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hello, 

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?


Later, the credits a vcpu gets is calculated by


     credit_fair = ( credit_fair + (sdom->active_vcpu_count -1)
                ) / sdom->active_vcpu_count -1

Again, I would expect that the credits are calculated by

     credit_fair =  credit_fair / sdom->active_vcpu_count


I do not understand why the term (sdom->active_vcpu_count -1 ) is
neccessary.

Best regards, 

Thomas Pfeuffer


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel