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] Odd behaviour of Xen guests on multiprocessor systems ?

To: Arjun <cse.syslab@xxxxxxxxx>
Subject: Re: [Xen-devel] Odd behaviour of Xen guests on multiprocessor systems ?
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Wed, 26 Apr 2006 09:39:17 -0500
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 26 Apr 2006 07:39:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <896ae46a0604251756y2fc48955wb9d3a242e05284dd@xxxxxxxxxxxxxx>
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>
References: <896ae46a0604251756y2fc48955wb9d3a242e05284dd@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
* Arjun <cse.syslab@xxxxxxxxx> [2006-04-25 19:57]:
> I noticed an odd thing recenlty when running some experiments with several
> xen guests on a multiprocessor host:-
> 
> I was running some tests with infinite while loops inside the guests and
> used xentop on the host to see what was happening.
> Firstly, xentop doesn't give per-physical-cpu information for
> multiprocessors, it gives VCPU information (have a separate posted query on
> this).
> During the tests I noticed that in some cases I, when I started the infinite
> loops inside the guests, 2 guests appeared to be on the same
> CPU - I inferred this because xentop would show 49.9% VCPU usage for each of
> the 2 guests. In other cases, the 2 guests appeared to be on different
> CPUs because xentop would show 99.9% VCPU usage for each. This state would
> remain the same for however long I ran the experiment.

You should run xm vcpu-list.  This will give you a vcpu to cpu mapping
for each domain running.

[root@x460-3 ~]# xm list dom1
Name                              ID Mem(MiB) VCPUs State  Time(s)
dom1                               1      768     2 -b----     9.8

Two vcpu domain running..

[root@x460-3 ~]# xm vcpu-list dom1
Name                              ID  VCPU  CPU  State  Time(s)  CPU Affinity
dom1                               1     0    2   -b-       3.3  2
dom1                               1     1    3   -b-       3.0  3

I see that dom1 is using cpus 2 and 3.

> 
> Can anyone explain why this is the case ? Once a guest VM is started on a
> multiprocessor system, does it always stick to one particular physical

Xen does not migrate VCPUs between physical cpus automatically.  One can
force a migration via the xm vcpu-pin command.

[root@x460-3 ~]# xm vcpu-pin dom1 1 6
[root@x460-3 ~]# xm vcpu-list dom1
Name                              ID  VCPU  CPU  State  Time(s)  CPU Affinity
dom1                               1     0    2   -b-       8.4  2
dom1                               1     1    6   -b-       4.8  6

> CPU ? If so why and doesn't this have some serious implications for
> provisioning for mulitple colocated VMs ?

When a domain is created, Xen chooses processors with the fewest number
of VCPUs present.  There is certainly room for a user-space load
balancer which can migrate vcpus around according to load.


-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@xxxxxxxxxx

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>