[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 20/33] spapr: Don't use QOM [*] syntax for DR connector
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 20/33] spapr: Don't use QOM [*] syntax for DR connectors. |
Date: |
Mon, 21 Sep 2015 11:06:15 +1000 |
The dynamic reconfiguration (hotplug) code for the pseries machine type
uses a "DR connector" QOM object for each resource it will be possible
to hotplug. Each of these is added to its owner using
object_property_add_child(owner, "dr-connector[*], ...);
That works ok, mostly, but it means that the property indices are
arbitrary, depending on the order in which the connectors are constructed.
That might line up to something useful, but it doesn't have to.
It will get worse once we add hotplug RAM support. That will add a DR
connector object for every 256MB of potential memory. So if maxmem=2T,
for example, there are 8192 objects under the same parent.
The QOM interfaces aren't really designed for this. In particular
object_property_add() with [*] has O(n^2) time complexity (in the number of
existing children): first it has a linear search through array indices to
find a free slot, each of which is attempted to a recursive call to
object_property_add() with a specific [N]. Those calls are O(n) because
there's a linear search through all properties to check for duplicates.
By using a meaningful index value, which we already know is unique we can
avoid the [*] special behaviour. That lets us reduce the total time for
creating the DR objects from O(n^3) to O(n^2).
O(n^2) is still kind of crappy, but it's enough to reduce the startup time
of qemu (with in-progress memory hotplug support) with maxmem=2T from ~20
minutes to ~4 seconds.
Signed-off-by: David Gibson <address@hidden>
Cc: Bharata B Rao <address@hidden>
Tested-by: Bharata B Rao <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
---
hw/ppc/spapr_drc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index b7b9891..5d6ea7c 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -473,14 +473,17 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner,
{
sPAPRDRConnector *drc =
SPAPR_DR_CONNECTOR(object_new(TYPE_SPAPR_DR_CONNECTOR));
+ char *prop_name;
g_assert(type);
drc->type = type;
drc->id = id;
drc->owner = owner;
- object_property_add_child(owner, "dr-connector[*]", OBJECT(drc), NULL);
+ prop_name = g_strdup_printf("dr-connector[%"PRIu32"]", get_index(drc));
+ object_property_add_child(owner, prop_name, OBJECT(drc), NULL);
object_property_set_bool(OBJECT(drc), true, "realized", NULL);
+ g_free(prop_name);
/* human-readable name for a DRC to encode into the DT
* description. this is mainly only used within a guest in place
--
2.4.3
- [Qemu-ppc] [PULL 11/33] sPAPR: Introduce rtas_ldq(), (continued)
- [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, 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 <=
- [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
- [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