From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: Question on Credit accounting in Credit Scheduler Date: Thu, 29 Jul 2010 14:35:22 +0100 Message-ID: <20100729133522.GW13291@whitby.uk.xensource.com> References: <1280409687.8054.18.camel@bmwve02.lpr.e-technik.tu-muenchen.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: <1280409687.8054.18.camel@bmwve02.lpr.e-technik.tu-muenchen.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Thomas Pfeuffer Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org At 14:21 +0100 on 29 Jul (1280413287), Thomas Pfeuffer wrote: > 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? It makes the integer division round up instead of rounding down. Tim. -- Tim Deegan Principal Software Engineer, XenServer Engineering Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)