From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: Question about the ability of credit scheduler to handle I/O and CPU intensive VMs Date: Tue, 5 Oct 2010 16:02:05 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Yuehai Xu Cc: xen-devel@lists.xensource.com, yhxu@wayne.edu List-Id: xen-devel@lists.xenproject.org On Tue, Oct 5, 2010 at 3:56 PM, Yuehai Xu wrote: > I know in the kernel of Linux, when a process is stocked because of > I/O, it will be deleted from runnable queue, so that the scheduler of > CPU can select next runnable process immediately. However, I thought > this was different from the scheduling of XEN. Since the scheduler > didn't really know whether the VCPU was consuming PCPU, it just > provided a certain period of time to the VM. I might be wrong. If it > is true, even a most idle VM should always consumes as the same PCPU > time as the busy one =A0in my scheduler. But the result is opposite. The > idle VM consumes much less PCPU then the busy one. This should not be > determined by the scheduling itself, otherwise, the idle one should > also have 50% PCPU. Then, what mechanism cause this result? Your understanding of Xen is not correct. In Xen, the VM itself will initiate blocking if there is nothing for it to do. PV domains call SCHED_OP_block(), which will cause the VM to block until it is woken by an event channel; and HVM domains will execute the HLT instruction, which will cause the VM to block until it is woken by an interrupt. If you do a more complete trace (i.e., "xentrace -e all") and look at the results with xenalyze, you'll see dom2 making a sched_op hypercall, then transitioning from RUNSTATE_running to RUNSTATE_blocked. -George