From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8dfk-00062J-5U for qemu-devel@nongnu.org; Thu, 02 Jun 2016 21:13:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8dfh-00066n-PJ for qemu-devel@nongnu.org; Thu, 02 Jun 2016 21:13:11 -0400 Date: Fri, 3 Jun 2016 11:14:42 +1000 From: David Gibson Message-ID: <20160603011442.GC1087@voom.fritz.box> References: <201606010952.u519n6ri025307@mx0a-001b2d01.pphosted.com> <574EB66E.1040805@redhat.com> <20160602004222.GE15455@voom.fritz.box> <201606020440.u524ZiVe027809@mx0a-001b2d01.pphosted.com> <574FDA33.3040001@redhat.com> <20160602140737.GB18628@in.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NU0Ex4SbNnrxsi6C" Content-Disposition: inline In-Reply-To: <20160602140737.GB18628@in.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v0 0/2] Increase max memslots to 512 for PowerPC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: Thomas Huth , imammedo@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, pbonzini@redhat.com --NU0Ex4SbNnrxsi6C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 02, 2016 at 07:37:37PM +0530, Bharata B Rao wrote: > On Thu, Jun 02, 2016 at 09:03:15AM +0200, Thomas Huth wrote: > > On 02.06.2016 06:39, Bharata B Rao wrote: > > ... > > > Agreed. Here is the updated patch: > > >=20 > > > spapr: Increase hotpluggable memory slots to 256 > > >=20 > > > From: Bharata B Rao > > >=20 > > > KVM now supports 512 memslots on PowerPC (earlier it was 32). Allow h= alf > > > of it (256) to be used as hotpluggable memory slots. > > >=20 > > > Instead of hard coding the max value, use the KVM supplied value if K= VM > > > is enabled. Otherwise resort to the default value of 32. > > >=20 > > > Signed-off-by: Bharata B Rao > > > --- > > > hw/ppc/spapr.c | 15 +++++++++++++-- > > > 1 file changed, 13 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > > index 44e401a..c82adef 100644 > > > --- a/hw/ppc/spapr.c > > > +++ b/hw/ppc/spapr.c > > > @@ -1816,11 +1816,22 @@ static void ppc_spapr_init(MachineState *mach= ine) > > > /* initialize hotplug memory address space */ > > > if (machine->ram_size < machine->maxram_size) { > > > ram_addr_t hotplug_mem_size =3D machine->maxram_size - machi= ne->ram_size; > > > + /* > > > + * Number of memslots supported by KVM on PowerPC was increa= sed > > > + * from 32 to 512. Let us limit the number of hotpluggable s= lots > > > + * to half of that (256). However ensure that number of slots > > > + * doesn't drop below 32 on older hosts. > > > + */ > >=20 > > Using "hard-coded" information like "increased to 512" in comments is > > true for the current state, but this has a risk of being out of date > > soon. Once we change the memslots in the kernel, this comment is not > > true anymore and might cause confusion. Better talk about leaving half > > of the kernel memslots for PCI and other devices, or so. >=20 > Just want to note that even though we are limiting hotpluggable memory > slots to half of max, it is always possible for other devices to eat > into the memory hotplug slots, right ? >=20 > David - here is the patch updated with comments as suggested by Thomas. > If you need a separate post, let me know. Applied to ppc-for-2.7, thanks. >=20 > spapr: Increase hotpluggable memory slots to 256 >=20 > From: Bharata B Rao >=20 > KVM now supports 512 memslots on PowerPC (earlier it was 32). Allow half > of it (256) to be used as hotpluggable memory slots. >=20 > Instead of hard coding the max value, use the KVM supplied value if KVM > is enabled. Otherwise resort to the default value of 32. >=20 > Signed-off-by: Bharata B Rao > Reviewed-by: Thomas Huth > --- > hw/ppc/spapr.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 44e401a..14cc6ae 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1816,11 +1816,21 @@ static void ppc_spapr_init(MachineState *machine) > /* initialize hotplug memory address space */ > if (machine->ram_size < machine->maxram_size) { > ram_addr_t hotplug_mem_size =3D machine->maxram_size - machine->= ram_size; > + /* > + * Limit the number of hotpluggable memory slots to half the num= ber > + * slots that KVM supports, leaving the other half for PCI and o= ther > + * devices. However ensure that number of slots doesn't drop bel= ow 32. > + */ > + int max_memslots =3D kvm_enabled() ? kvm_get_max_memslots() / 2 : > + SPAPR_MAX_RAM_SLOTS; > =20 > - if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) { > + if (max_memslots < SPAPR_MAX_RAM_SLOTS) { > + max_memslots =3D SPAPR_MAX_RAM_SLOTS; > + } > + if (machine->ram_slots > max_memslots) { > error_report("Specified number of memory slots %" > PRIu64" exceeds max supported %d", > - machine->ram_slots, SPAPR_MAX_RAM_SLOTS); > + machine->ram_slots, max_memslots); > exit(1); > } > =20 >=20 --=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 --NU0Ex4SbNnrxsi6C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXUNoCAAoJEGw4ysog2bOS4lAP/1q21Q1jPXduEsVV5KRmobex FcRVkUXCvy88GHD6BE6g/jlJmEdXrQ6580tfFcGXKUyaJLKNxDJijVqxGeABRBxz xYyRI8pxZ+dmyAtisf73rcVtragr6i8G5H1IRQ4U4jyfF0V3hh5wPIgOL+6m90uE kTRkl3yUVF+P9n83oPLSDJwfJWTYlS5k92mkF9MWG0fUfp4TjW6h3SN9lsJwK+oE RzXjfhy2icgApbziIDnsetL6NqXXnNWkpJj1N9cXhYD98+eHU3r2RGC2XWIZajrn eAf/wBaABMTfY523a+H4ZG1fBppAHwXCkPIGRAQtMqfzOrA/RqFIp3O1lzMwQBV/ 8z6P7Xm+KEMAjYj+e6zkSKksYOojhiafIzmYXKIZ7Gwbu+hhhEmx2XD8RLjAP6G2 1njnpM8dDCaspzpBtiFoR2Mv6P4uCRF4Cnx5KD3gotX2Zi6CMf8nZ22lJBv6TsAS Y0cjTeS8QHwlW1hDqiQyt7smouZac461OOdne+ylTA53mSEhJu565bq3cdKQwP5j iL2MstG2vFdOmXG+BUpKw+zrhDsONSe9cAXInmMstvIEIXu5FTgFDuFMg/SQMQiz KliBmpoUd+Q0ds+C9phCqE0/qrS+3dg63wu9ycvpaM29v7PEY45w7/zxwca+XeLr +ebQpqYmNmiNDmpn8f71 =6DPK -----END PGP SIGNATURE----- --NU0Ex4SbNnrxsi6C--