[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Dual Core processor options



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.