[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.