[libvirt] [RFC] NUMA topology specification

Osier Yang jyang at redhat.com
Fri Aug 19 07:25:19 UTC 2011


于 2011年08月19日 14:35, Bharata B Rao 写道:
> Hi,
>
> qemu supports specification of NUMA topology on command line using -numa option.
>
> -numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node]
>
> I see that there is no way to specify such NUMA topology in libvirt
> XML. Are there plans to add support for NUMA topology specification ?
> Is anybody already working on this ? If not I would like to add this
> support for libvirt.
>
> Currently the topology specification available in libvirt (<topology
> sockets='1' cores='2' threads='1'/>) translates to "-smp
> sockets=1,cores=2,threads=1" option of qemu. There is not equivalent
> in libvirt that could generate -numa command line option of qemu.
>
> How about something like this ? (OPTION 1)
>
> <cpu>
> ...
> <numa nodeid='node' cpus='cpu[-cpu]' mem='size'>
> ...
> </cpu>
>

Libvirt already supported NUMA setting (both cpu and memory)
on host yet, but yes, nothing for NUMA setting inside guest yet.

We have talked once about the XML when adding the support
for numa memory setting on host. And finally choosed to introduce
new XML node for it with considering to add support for NUMA
setting inside guest one day. The XML is:

<numatune>
<memory mode="strict" nodeset="1-4,^3"/>
</numatune>

So, personlly, I think the new XML should be inside "<numatune>"
as a child node.


> And we could specify multiple such lines, one for each node.
>
> -numa and -smp options in qemu do not work all that well since they
> are parsed independent of each other and one could specify a cpu set
> with -numa option that is incompatible with sockets,cores and threads
> specified on -smp option. This should be fixed in qemu, but given that
> such a problem has been observed, should libvirt tie the specification
> of numa and smp (sockets,threads,cores) together so that one is forced
> to specify only valid combinations of nodes and cpus in libvirt ?
>
> May be something like this: (OPTION 2)
>
> <cpu>
> ...
> <topology sockets='1' cores='2' threads='1' nodeid='0' cpus='0-1' mem='size'>
> <topology sockets='1' cores='2' threads='1' nodeid='1' cpus='2-3' mem='size'>
> ...
> </cpu

This will cause we have 3 places for NUMA, one is <numatune>, the
other is "<vcpu>", and this one. We can't change the "<vcpu>" as it
was introduce much earlier than "<numatune>", but after <numatune>
was introduced, I guess it's better to folder all NUMA stuffs in it.

> This should result in a 2 node system with each node having 1 socket
> with 2 cores.
>
> Comments, suggestions ?
>
> Regards,
> Bharata.




More information about the libvir-list mailing list