[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 32/33] spapr: Fix default NUMA node allocation for thre
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 32/33] spapr: Fix default NUMA node allocation for threads |
Date: |
Mon, 21 Sep 2015 11:06:27 +1000 |
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 <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
---
hw/ppc/spapr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 430fac4..6ccf26f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2162,6 +2162,13 @@ static HotplugHandler
*spapr_get_hotpug_handler(MachineState *machine,
return NULL;
}
+static unsigned spapr_cpu_index_to_socket_id(unsigned cpu_index)
+{
+ /* Allocate to NUMA nodes on a "socket" basis (not that concept of
+ * socket means much for the paravirtualized PAPR platform) */
+ return cpu_index / smp_threads / smp_cores;
+}
+
static void spapr_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -2183,6 +2190,7 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
mc->get_hotplug_handler = spapr_get_hotpug_handler;
hc->plug = spapr_machine_device_plug;
hc->unplug = spapr_machine_device_unplug;
+ mc->cpu_index_to_socket_id = spapr_cpu_index_to_socket_id;
smc->dr_lmb_enabled = false;
fwc->get_dev_path = spapr_get_fw_dev_path;
--
2.4.3
- [Qemu-ppc] [PULL 12/33] pseries: define coldplugged devices as "configured", (continued)
- [Qemu-ppc] [PULL 12/33] pseries: define coldplugged devices as "configured", David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 24/33] spapr: Make hash table size a factor of maxram_size, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 21/33] spapr: Use QEMU limit for maximum CPUs number, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 15/33] spapr: Enable in-kernel H_SET_MODE handling, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 18/33] spapr: Initialize hotplug memory address space, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 31/33] spapr: Move memory hotplug to RTAS_LOG_V6_HP_ID_DRC_COUNT type, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 26/33] spapr: Don't allow memory hotplug to memory less nodes, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 28/33] spapr: Populate ibm, associativity-lookup-arrays correctly for non-NUMA, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 20/33] spapr: Don't use QOM [*] syntax for DR connectors., David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 17/33] spapr_drc: don't allow 'empty' DRCs to be unisolated or allocated, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 32/33] spapr: Fix default NUMA node allocation for threads,
David Gibson <=
- [Qemu-ppc] [PULL 33/33] ppc/spapr: Fix buffer overflow in spapr_populate_drconf_memory(), David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 25/33] spapr: Memory hotplug support, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 30/33] spapr: Support hotplug by specifying DRC count, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 29/33] spapr: Revert to address@hidden representation for non-hotplugged memory, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 19/33] spapr_drc: use RTAS return codes for methods called by RTAS, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 22/33] spapr: Add LMB DR connectors, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 23/33] spapr: Support ibm, dynamic-reconfiguration-memory, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 13/33] pseries: Update SLOF firmware image to qemu-slof-20150813, David Gibson, 2015/09/20
- Re: [Qemu-ppc] [PULL 00/33] spapr-next queue 2015-09-16, Peter Maydell, 2015/09/21