spapr: Fix default NUMA node allocation for threads
commit20bb648dca6d7fe8cdd1941194e7851950b25dc5
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Sep 2015 01:21:52 +0000 (8 11:21 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 23 Sep 2015 00:51:11 +0000 (23 10:51 +1000)
treef8ed18f058df077c496c7bdf08bc845d620969b3
parent0a4178692c2375a4516da7b71629bd08ee8697ee
spapr: Fix default NUMA node allocation for threads

At present, if guest numa nodes are requested, but the cpus in each node
are not specified, spapr just uses the default behaviour or assigning each
vcpu round-robin to nodes.

If smp_threads != 1, that will assign adjacent threads in a core to
different NUMA nodes.  As well as being just weird, that's a configuration
that can't be represented in the device tree we give to the guest, which
means the guest and qemu end up with different ideas of the NUMA topology.

This patch implements mc->cpu_index_to_socket_id in the spapr code to
make sure vcpus get assigned to nodes only at the socket granularity.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
hw/ppc/spapr.c