From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzDAp-0003UQ-An for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzDAn-0006MS-Mc for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:35 -0400 Date: Wed, 26 Oct 2016 11:49:37 +1100 From: David Gibson Message-ID: <20161026004937.GQ11052@umbus.fritz.box> References: <1477370856-8940-1-git-send-email-mdroth@linux.vnet.ibm.com> <1477370856-8940-10-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xYEXny2b0/vlBQCR" Content-Disposition: inline In-Reply-To: <1477370856-8940-10-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 09/10] spapr: use count+index for memory hotplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: qemu-devel@nongnu.org, nfont@linux.vnet.ibm.com, qemu-ppc@nongnu.org, jallen@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com --xYEXny2b0/vlBQCR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2016 at 11:47:35PM -0500, Michael Roth wrote: > Commit 0a417869: >=20 > spapr: Move memory hotplug to RTAS_LOG_V6_HP_ID_DRC_COUNT type >=20 > dropped per-DRC/per-LMB hotplugs event in favor of a bulk add via a > single LMB count value. This was to avoid overrunning the guest EPOW > event queue with hotplug events. This works fine, but relies on the > guest exhaustively scanning for pluggable LMBs to satisfy the > requested count by issuing rtas-get-sensor(DR_ENTITY_SENSE, ...) calls > until all the LMBs associated with the DIMM are identified. >=20 > With newer support for dedicated hotplug event source, this queue > exhaustion is no longer as much of an issue due to implementation > details on the guest side, but we still try to avoid excessive hotplug > events by now supporting both a count and a starting index to avoid > unecessary work. This patch makes use of that approach when the > capability is available. >=20 > Cc: bharata@linux.vnet.ibm.com > Signed-off-by: Michael Roth Reviewed-by: David Gibson > --- > hw/ppc/spapr.c | 22 ++++++++++++++++++---- > 1 file changed, 18 insertions(+), 4 deletions(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index dc4224b..0b3aa2f 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -2202,14 +2202,16 @@ static void spapr_nmi(NMIState *n, int cpu_index,= Error **errp) > } > } > =20 > -static void spapr_add_lmbs(DeviceState *dev, uint64_t addr, uint64_t siz= e, > - uint32_t node, Error **errp) > +static void spapr_add_lmbs(DeviceState *dev, uint64_t addr_start, uint64= _t size, > + uint32_t node, bool dedicated_hp_event_source, > + Error **errp) > { > sPAPRDRConnector *drc; > sPAPRDRConnectorClass *drck; > uint32_t nr_lmbs =3D size/SPAPR_MEMORY_BLOCK_SIZE; > int i, fdt_offset, fdt_size; > void *fdt; > + uint64_t addr =3D addr_start; > =20 > for (i =3D 0; i < nr_lmbs; i++) { > drc =3D spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB, > @@ -2228,7 +2230,17 @@ static void spapr_add_lmbs(DeviceState *dev, uint6= 4_t addr, uint64_t size, > * guest only in case of hotplugged memory > */ > if (dev->hotplugged) { > - spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lm= bs); > + if (dedicated_hp_event_source) { > + drc =3D spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB, > + addr_start / SPAPR_MEMORY_BLOCK_SIZE); > + drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); > + spapr_hotplug_req_add_by_count_indexed(SPAPR_DR_CONNECTOR_TY= PE_LMB, > + nr_lmbs, > + drck->get_index(drc)); > + } else { > + spapr_hotplug_req_add_by_count(SPAPR_DR_CONNECTOR_TYPE_LMB, > + nr_lmbs); > + } > } > } > =20 > @@ -2261,7 +2273,9 @@ static void spapr_memory_plug(HotplugHandler *hotpl= ug_dev, DeviceState *dev, > goto out; > } > =20 > - spapr_add_lmbs(dev, addr, size, node, &error_abort); > + spapr_add_lmbs(dev, addr, size, node, > + spapr_ovec_test(ms->ov5_cas, OV5_HP_EVT), > + &error_abort); > =20 > out: > error_propagate(errp, local_err); --=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 --xYEXny2b0/vlBQCR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYD/2gAAoJEGw4ysog2bOSRWYP/imdwgGN3q1PXcEwbVgIdSsy 5ScybbYFB00cQTOdMW+CcrapWY41HppKf7WRJ91PyQICDhuPqqbSsh0XF1RbkmN8 DUmknsj/r7m9+3gfb8PR0cVFRkcVdvo+0gf6VP2ehhAfo8BhQGoKnGa+/E+LxCWg jolgXti0AHj29tBJg6HCREb9r1FAqfAbm5O8xLoCwMJo06vbiOMZ5op7KzKWjjUI tyqcYX79HO29pxplDS8r3BYaBxj8QBroV8jtM5ZhrynphsPwZZFTO4W0E1EeF6FB sGB5P7S0gn9Kfg+um8BPLawaMJtiEYPnqb7AtWgCSMsMT3VaUd7WZ9yHrXxA0slG 5DjCt0zf4Bt6I9ybbcAR8RYCI+Ol5olqEydGp6RsBy5HXcbRHM43fpM4s1P8w+48 iSVTlkLSTpoppeU0nf8alyMXLxkVisS3wnOjc8H4W6tlLWChwgNjtdID7sIYXvsF /Op92u3a4+pLlcIW8BdGu4Z8BFCigSb3iJeCS1CNfuu+k5vFJl45wgvPbdHnA1ty XRRhUbef3aXKX+tzy1z1Jg12cX0ImiMxj/DRHMSzKC7IfNM8LupDKYBxFJXAwBvJ vRkK1h9C+Iu1k5NtDCTVRCayy2CxIajstebtQhikFM2Hkq4sd9GSi23zbEKEmB7X lxqsvQnXJoyOOd5RX8GL =bJ41 -----END PGP SIGNATURE----- --xYEXny2b0/vlBQCR--