[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 26/33] spapr: Don't allow memory hotplug to memory less
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 26/33] spapr: Don't allow memory hotplug to memory less nodes |
Date: |
Mon, 21 Sep 2015 11:06:21 +1000 |
From: Bharata B Rao <address@hidden>
Currently PowerPC kernel doesn't allow hot-adding memory to memory-less
node, but instead will silently add the memory to the first node that has
some memory. This causes two unexpected behaviours for the user.
- Memory gets hotplugged to a different node than what the user specified.
- Since pc-dimm subsystem in QEMU still thinks that memory belongs to
memory-less node, a reboot will set things accordingly and the previously
hotplugged memory now ends in the right node. This appears as if some
memory moved from one node to another.
So until kernel starts supporting memory hotplug to memory-less
nodes, just prevent such attempts upfront in QEMU.
Signed-off-by: Bharata B Rao <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 9ab6284..23d4d85 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2136,7 +2136,7 @@ static void spapr_machine_device_plug(HotplugHandler
*hotplug_dev,
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine());
if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
- uint32_t node;
+ int node;
if (!smc->dr_lmb_enabled) {
error_setg(errp, "Memory hotplug not supported for this machine");
@@ -2147,6 +2147,28 @@ static void spapr_machine_device_plug(HotplugHandler
*hotplug_dev,
return;
}
+ /*
+ * Currently PowerPC kernel doesn't allow hot-adding memory to
+ * memory-less node, but instead will silently add the memory
+ * to the first node that has some memory. This causes two
+ * unexpected behaviours for the user.
+ *
+ * - Memory gets hotplugged to a different node than what the user
+ * specified.
+ * - Since pc-dimm subsystem in QEMU still thinks that memory belongs
+ * to memory-less node, a reboot will set things accordingly
+ * and the previously hotplugged memory now ends in the right node.
+ * This appears as if some memory moved from one node to another.
+ *
+ * So until kernel starts supporting memory hotplug to memory-less
+ * nodes, just prevent such attempts upfront in QEMU.
+ */
+ if (nb_numa_nodes && !numa_info[node].node_mem) {
+ error_setg(errp, "Can't hotplug memory to memory-less node %d",
+ node);
+ return;
+ }
+
spapr_memory_plug(hotplug_dev, dev, node, errp);
}
}
--
2.4.3
- [Qemu-ppc] [PULL 14/33] pseries: Fix incorrect calculation of threads per socket for chip-id, (continued)
- [Qemu-ppc] [PULL 14/33] pseries: Fix incorrect calculation of threads per socket for chip-id, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 02/33] spapr: Create pseries-2.5 machine, David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 11/33] sPAPR: Introduce rtas_ldq(), David Gibson, 2015/09/20
- [Qemu-ppc] [PULL 27/33] spapr: Provide better error message when slots exceed max allowed, David Gibson, 2015/09/20
- [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 <=
- [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, 2015/09/20
- [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