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

Re: [Xen-devel] Re: Xen cpu Scheduling

To: ncmike@xxxxxxxxxx
Subject: Re: [Xen-devel] Re: Xen cpu Scheduling
From: pak333@xxxxxxxxxxx
Date: Wed, 21 Mar 2007 05:48:41 +0000
Cc: "Mike D. Day" <ncmike@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 20 Mar 2007 22:47:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks for the explanation.
I still have questions about how cpu utilization is reported by xm top/xentop. If someone can answer the question as to how the cpu% is calculated, when a VM with 2 vcpus, is only using 1 pcpu at any given point of time.
 
Also, a vcpu is given the full pcpu. What if it doesn't use the full pcpu. How is it scheduled?
thanks
Prabha
 
 
-------------- Original message --------------
From: "Mike D. Day" <ncmike@xxxxxxxxxx>

> On 20/03/07 01:37 +0000, pak333@xxxxxxxxxxx wrote:
> >
> > 1. Suppose I give a VM 2 vcpus. When this VM gets scheduled will it
> > always be given two pcpus or can it be given 1vcpu also sometimes.
> > For example if we have mutiple VMs running, and if a cpu gets freed up
> > will my 2vcpu VM be scheduled on this single free cpu. If a single
> > cpu cna be given how is the cpu % calculated by xentop
>
> It depends on how busy the CPUs are on the machine, and the ratio of
> VCPU to PCPU.
>
> When the VM has two VCPUs, each VCPU (when runnable) will be put on
> the run queue of a physical CPU. This VM will run concurrently on AT
> MOST 2 PCPUs, sometimes only 1 PCPU. If on the platf orm VCPU == PCPU
> in aggregate then the VM with 2 VCPUs will frequently run concurrently
> on two PCPUs.
>
>
> >
> > 2. If the 2vcpu is scheduled on two cpus, and one of its threads goes
> > to sleep can that single thread be context swtiched out. or will it be
> > kept spinning.
>
> VM's get scheduled as VCPUs, not threads. Having two VCPU's for a VM
> is sort of like a process having two threads. But there are a lot of
> differences as well so don't take the analogy too far.
>
> When a VCPU for a VM is not running it is not executing any code. The
> VCPU can be runnable, running, or sleeping. It only executes code when
> it is running.
>
> However, remember that *kernel threads* are scheduled by the guest kernel,
> while the guest kernel is scheduled as one or more VCPUs by *xen.* The
> guest kernel is allowed to put its own thre ads to sleep and awaken
> other threads, but when Xen decides that the time slice is over for a
> VCPU, then that VCPU gets rescheduled at the back of the q, or put to
> sleep.
>
> I don't know very much about xentop.
>
> Mike
>
> --
> Mike D. Day
> IBM LTC
> Cell: 919 412-3900
> Sametime: ncmike@xxxxxxxxxx AIM: ncmikeday Yahoo: ultra.runner
> PGP key: http://www.ncultra.org/ncmike/pubkey.asc
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] Re: Xen cpu Scheduling, pak333 <=