From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbLAo-00052s-Vg for qemu-devel@nongnu.org; Mon, 14 Sep 2015 00:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbLAk-00052d-PN for qemu-devel@nongnu.org; Mon, 14 Sep 2015 00:15:22 -0400 Date: Mon, 14 Sep 2015 14:14:59 +1000 From: David Gibson Message-ID: <20150914041459.GJ2547@voom.fritz.box> References: <1442194913-26545-1-git-send-email-david@gibson.dropbear.id.au> <1442194913-26545-3-git-send-email-david@gibson.dropbear.id.au> <20150914040716.GO17433@in.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SBT+cnFS/G3NVgv4" Content-Disposition: inline In-Reply-To: <20150914040716.GO17433@in.ibm.com> Subject: Re: [Qemu-devel] [RFCv2 2/2] spapr: Don't use QOM [*] syntax for DR connectors. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: agraf@suse.de, aik@ozlabs.ru, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com --SBT+cnFS/G3NVgv4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 14, 2015 at 09:37:16AM +0530, Bharata B Rao wrote: > On Mon, Sep 14, 2015 at 11:41:53AM +1000, David Gibson wrote: > > 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[*], ...); > >=20 > > That works ok, mostly, but it means that the property indices are > > arbitrary, depending on the order in which the connectors are construct= ed. > > When we have both memory and cpu hotplug, the connectors will be under = the > > same parent (at least in the current drafts), meaning the indices don't > > correspond to any meaningful ID. > >=20 > > It gets worse when large amounts of hotpluggable RAM is configured. For > > RAM, there's a DR connector object for every 256MB of potential memory.= So > > if maxmem=3D2T, for example, there are 8192 objects under the same pare= nt. > >=20 > > The QOM interfaces aren't really designed for this. In particular > > object_property_add() with [*] has O(n^2) time complexity (in the numbe= r 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. > >=20 > > By using a meaningful index value, which we already know is unique we c= an > > avoid the [*] special behaviour. That lets us reduce the total time for > > creating the DR objects from O(n^3) to O(n^2). > >=20 > > O(n^2) is still kind of crappy, but it's enough to reduce the startup t= ime > > of qemu with maxmem=3D2T from ~20 minutes to ~4 seconds. > >=20 > > Signed-off-by: David Gibson > > Cc: Bharata B Rao >=20 > This patch works correctly with both CPU and memory hotplug. Care to send a Reviewed-by and/or Tested-by in that case? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --SBT+cnFS/G3NVgv4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV9knDAAoJEGw4ysog2bOSs4AP/1VAtZGva7TkLtz5G4Gsx3+G XFHPo0JVtUuNospUy0FVCd8dDsavPnNe9Oc9y+LlNsXshwR+3lWPKm2xs+MPdLx2 PmtsqlBiXFAHiTV95LsgHYhSAupbfHOnmhVo5ChouquR3PBg/1MOnhrbxAhTel7/ cC888F0fLGMjFzBeZ7sPKnVuFDy5ykQtz4Ii9Sfg7rVB0i4v1JK48JJD6GQGcUHO /2Odsr+v+7XGOCeUsHZv/1gRU97nY84VqGlTBi77ZTrcPGQNXGNWncJDMhp+Q1YS ZIQTUMOxY7E/kFosHE4RYag5aUFd7LcSkkI3gsEdqFz0LY7ausDBlINwOp0KEojM /fhyWUCOOwIZAbYvDneQNUwy+yluCsCpLHJ5IXuezMeLhOBlTfJ95qHnNHwDctXm TJeYmfm/llTa7LFZrHFq+LmwV3EQdqhKurkXNoMI/r4bDD3+dzkV1Iwn7EkifxzA Iv1N82SrOhzSQOCOwXpKA+IjdronNqeYMNi0HCvNBrjCD8XPyBjqMSgwGbg3zceV lSvEZOSMUAX9XndPY5xYucN86fR6RPWU7vurG9uBIShSPBTaML4WlCxnzhN/UmWG zH/aMjqYu53xBnzL3z4pV7pobDzwWJHZ1Wwn4EPakvb53wqdlYp/RkSbCPpKtiRf f7KYlPBp/FxV952M5hZG =PsYs -----END PGP SIGNATURE----- --SBT+cnFS/G3NVgv4--