From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] xen, credit2: Avoid extra c2t calcuation in csched_runtime Date: Thu, 24 Jan 2013 16:10:28 +0000 Message-ID: <51015CF4.6010608@eu.citrix.com> References: <5101652C02000078000B93E2@nat28.tlf.novell.com> <5101595A.2060509@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5101595A.2060509@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 24/01/13 15:55, George Dunlap wrote: >> >>> struct csched_runqueue_data *rqd = RQD(ops, cpu); >>> struct list_head *runq = &rqd->runq; >>> if ( is_idle_vcpu(snext->vcpu) ) >>> return CSCHED_MAX_TIMER; >>> - /* Basic time */ >>> - time = c2t(rqd, snext->credit, snext); >>> + /* General algorithm: >>> + * 1) Run until snext's credit will be 0 >>> + * 2) But if someone is waiting, run until snext's credit is equal >>> + * to his >>> + * 3) But never run longer than MAX_TIMER or shorter than >>> MIN_TIMER. >>> + */ >>> - /* Next guy on runqueue */ >>> + /* 1) Basic time: Run until credit is 0. */ >>> + rt_credit = snext->credit; >>> + >>> + /* 2) If there's someone waiting whose credit is positive, >> ... who's ...? > > Nope. :-) "Who's" is short for "who is". "Whose" is a pronoun which > links back to "someone waiting". (I suppose "whose" is the person > version of "which", which I used in both the previous sentence and > this one.) OK, for the really serious grammar students: "Whose" isn't a pronoun, it's an adjective indicating "owned by who" or "of who"; in this case, "whose" is modifying "credit". It's a similar construction to the following: "If there's someone waiting who has positive credit, ..." -George