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-users

Re: [Xen-users] Dual Core processor options

To: Simon <greminn@xxxxxxxxx>
Subject: Re: [Xen-users] Dual Core processor options
From: Steve Dobbelstein <steved@xxxxxxxxxx>
Date: Wed, 7 Dec 2005 19:21:11 -0600
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 08 Dec 2005 01:22:07 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <5bdb1aa70512071531t54fb6fa7r9682de24b49a8e93@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Simon <greminn@xxxxxxxxx> wrote on 12/07/2005 05:31:59 PM:

> Hi There, Having read about this somewhere recently, am i correct in
> assuming that if you have a (say) dual processor server with dual core
> processors, that you can assign domU's to individual cores? for
> example:
>
> 2 domUs on 1 core of one processor
> 1 domU on the other core of the same processor
> 1 domU to both cores of the other processor
>
> This allocation would of couse reflect the indented usage of domUs

In Xen 3.0 you can use the "cpus=" option in the domain configuration file
to set which cpus the domain's vcpus should map to.

As far as I know, you can't map the vcpus to cores or processors directly;
you map vcpus to cpus.

In my experience, you have to know ahead of time which processor and core a
CPU is on in order to know what the vcpu should map to.  And the assignment
of CPU numbers is not necessarily in a linear fashion, e.g. with
hyperthreading, CPU 0 ->core 0 -> processor 0, CPU 1 ->core 0 -> processor
0, CPU 2 ->core 1 -> processor 0, ... , CPU 4 ->core 0 -> processor 1, etc.
The only way I have found so far to discover Xen's mapping of CPUS to
processors and cores is to examine the output of "xm dmesg".

I wrote a little script to parse the output of "xm dmesg", extract the CPU
information, and print it out in a simpler format.  Here is some sample
output from my 4 processor, dual core, hyperthreaded machine.

Processor 0, Core 0, CPU 0
Processor 0, Core 0, CPU 10
Processor 0, Core 1, CPU 6
Processor 0, Core 1, CPU 14
Processor 1, Core 2, CPU 7
Processor 1, Core 2, CPU 15
Processor 1, Core 3, CPU 3
Processor 1, Core 3, CPU 11
Processor 2, Core 4, CPU 1
Processor 2, Core 4, CPU 8
Processor 2, Core 5, CPU 4
Processor 2, Core 5, CPU 12
Processor 3, Core 6, CPU 5
Processor 3, Core 6, CPU 13
Processor 3, Core 7, CPU 2
Processor 3, Core 7, CPU 9

As you can see the assignments are not linear according to IDs.  If dom0 is
running on cpu 0 and I want to put my domU on another processor, I can set
"cpus=1-5,7-9,11-13,15".  Not very straight forward, but it works.

Anyone with better knowledge or experience, feel free to comment and
correct.

Steve D.


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