From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZzHR-0000SX-6w for qemu-devel@nongnu.org; Thu, 10 Sep 2015 06:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZzHQ-0007vc-1Q for qemu-devel@nongnu.org; Thu, 10 Sep 2015 06:40:37 -0400 Date: Thu, 10 Sep 2015 20:30:57 +1000 From: David Gibson Message-ID: <20150910103057.GB11781@voom> References: <1441866505-10842-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC PATCH] spapr: Reduce creation of LMB DR connectors from O(n^3) to O(n^2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: aik@ozlabs.ru, "qemu-devel@nongnu.org Developers" , qemu-ppc@nongnu.org, Alexander Graf , Bharata B Rao --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 10, 2015 at 01:42:57AM -0700, Peter Crosthwaite wrote: > On Wed, Sep 9, 2015 at 11:28 PM, 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 > > This works ok for most cases, but gets ugly when allowing large amounts= of > > hotplugged RAM. For RAM, there's a DR connector object for every 256MB= of > > potential memory. So if maxmem=3D2T, for example, there are >250,000 o= bjects > > under the same parent. > > > > The QOM interfaces aren't really designed for this. In particular > > object_property_add() has O(n^2) time complexity (in the number of exis= ting > > children) for the [*] case. 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) bec= ause > > there's a linear search through all properties to check for duplicates. > > >=20 > Does this help? I think it's already queued: >=20 > >http://lists.nongnu.org/archive/html/qemu-devel/2015-07/msg05790.html It doesn't help our case; it's basically a fix for a different instance of the same problem. --=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 --H1spWtNR+x+ondvy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV8VvgAAoJEGw4ysog2bOSPm8QAITRJQYS/DYtU74fuFc+XJcl MJr3KltnU5/8/G2Xcz0Jaxw48eBBWCbkTit1iMxE04DN42t0Ww43HZqiuJoFdpKk y6O7wlYszIn2JAPtxIKvWumcdw2KgwZXGFlyQJIyb3fblUvpHW8skK8f/C/z+/Kt omzV5v4He7/AlZrHBFMD2ukJp9u/eJ5/Qg2a7ajC+SvmVzlOaU3Cge8MFZjfvprW f2VyeWTQz8fo9x1y9txcl+tQmgSYU3/I4+t74yrScFvQwnVywTsg1CzYfm4/LCH0 okGtPvvF2c2duEDJR0YepLuDAoGAa9JGfFZf0lI2LdELp5mTWslexb9YN1GpMtsD fYW5+t3uzl4uSd9M5W2MnzuvkXRhB0/HomzOVloqNmmntmyht/zsC5cxt46GlXh6 +BCMsmlwz75veKOQp7e5sDjrMSPClYfDPcwMT/ExvzcqTX6AgwUus08iI13zYIK9 oAVVG/YUbyJ6h2RjvhBoNYz6T9/QSWGvA5dSqgCCyDB68i/1B+j8/E16KmDb1fkC jaMylnLO0AH7dlBTF43aICopP+mRZqHFZsBeXJZvlQbzN9HbUlOspNesSU8DW1lc 72TBSLYlH2oY4guph0gu3tRkAbOkup40KvMiE/WZ9rZspvMLzuo46t77rGcPw47n +51wCZl9YZmJawaGvwSx =rOMN -----END PGP SIGNATURE----- --H1spWtNR+x+ondvy--