Received: from eggs.gnu.org ([2001:4830:134:3::10]:56585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avz8R-0004hm-4g for qemu-devel@nongnu.org; Thu, 28 Apr 2016 23:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avz8P-0005L0-Lj for qemu-devel@nongnu.org; Thu, 28 Apr 2016 23:30:31 -0400 Date: Fri, 29 Apr 2016 13:24:03 +1000 From: David Gibson Message-ID: <20160429032403.GA3010@littlecatz.fritz.box> References: <1458016736-10544-1-git-send-email-bharata@linux.vnet.ibm.com> <1458016736-10544-3-git-send-email-bharata@linux.vnet.ibm.com> <20160316013605.GC9032@voom> <20160316044154.GD13176@in.ibm.com> <20160425112050.545f4ff3@nial.brq.redhat.com> <20160426050923.GB9793@in.ibm.com> <20160426095236.23e51b77@nial.brq.redhat.com> <20160426210337.11723.83860@loki> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20160426210337.11723.83860@loki> Subject: Re: [Qemu-devel] [RFC PATCH v2 2/2] spapr: Memory hot-unplug support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: Igor Mammedov , Bharata B Rao , thuth@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, nfont@linux.vnet.ibm.com --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2016 at 04:03:37PM -0500, Michael Roth wrote: > Quoting Igor Mammedov (2016-04-26 02:52:36) > > On Tue, 26 Apr 2016 10:39:23 +0530 > > Bharata B Rao wrote: > >=20 > > > On Mon, Apr 25, 2016 at 11:20:50AM +0200, Igor Mammedov wrote: > > > > On Wed, 16 Mar 2016 10:11:54 +0530 > > > > Bharata B Rao wrote: > > > > =20 > > > > > On Wed, Mar 16, 2016 at 12:36:05PM +1100, David Gibson wrote: =20 > > > > > > On Tue, Mar 15, 2016 at 10:08:56AM +0530, Bharata B Rao wrote: = =20 > > > > > > > Add support to hot remove pc-dimm memory devices. > > > > > > >=20 > > > > > > > Signed-off-by: Bharata B Rao = =20 > > > > > >=20 > > > > > > Reviewed-by: David Gibson > > > > > >=20 > > > > > > Looks correct, but again, needs to wait on the PAPR change. =20 > > > > [...] =20 > > > > >=20 > > > > > While we are here, I would also like to get some opinion on the r= eal > > > > > need for memory unplug. Is there anything that memory unplug give= s us > > > > > which memory ballooning (shrinking mem via ballooning) can't give= ? =20 > > > > Sure ballooning can complement memory hotplug but turning it on wou= ld > > > > effectively reduce hotplug to balloning as it would enable overcomm= it > > > > capability instead of hard partitioning pc-dimms provides. So one > > > > could just use ballooning only and not bother with hotplug at all. > > > >=20 > > > > On the other hand memory hotplug/unplug (at least on x86) tries > > > > to model real hardware, thus removing need in paravirt ballooning > > > > solution in favor of native guest support. =20 > > >=20 > > > Thanks for your views. > > >=20 > > > >=20 > > > > PS: > > > > Guest wise, currently hot-unplug is not well supported in linux, > > > > i.e. it's not guarantied that guest will honor unplug request > > > > as it may pin dimm by using it as a non migratable memory. So > > > > there is something to work on guest side to make unplug more > > > > reliable/guarantied. =20 > > >=20 > > > In the above scenario where the guest doesn't allow removal of certain > > > parts of DIMM memory, what is the expected behaviour as far as QEMU > > > DIMM device is concerned ? I seem to be running into this situation > > > very often with PowerPC mem unplug where I am left with a DIMM device > > > that has only some memory blocks released. In this situation, I would= like > > > to block further unplug requests on the same device, but QEMU seems > > > to allow more such unplug requests to come in via the monitor. So > > > qdev won't help me here ? Should I detect such condition from the > > > machine unplug() handler and take required action ? > > I think offlining is a guests task along with recovering from > > inability to offline (i.e. offline all + eject or restore original stat= e). > > QUEM does it's job by notifying guest what dimm it wants to remove > > and removes it when guest asks it (at least in x86 world). >=20 > In the case of pseries, the DIMM abstraction isn't really exposed to > the guest, but rather the memory blocks we use to make the backing > memdev memory available to the guest. During unplug, the guest > completely releases these blocks back to QEMU, and if it can only > release a subset of what's requested it does not attempt to recover. > We can potentially change that behavior on the guest side, since > partially-freed DIMMs aren't currently useful on the host-side... >=20 > But, in the case of pseries, I wonder if it makes sense to maybe go > ahead and MADV_DONTNEED the ranges backing these released blocks so the > host can at least partially reclaim the memory from a partially > unplugged DIMM? Urgh.. I can see the benefit, but I'm a bit uneasy about making the DIMM semantics different in this way on Power. I'm shoehorning the PAPR DR memory mechanism into the qemu DIMM model was a good idea after all. --=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 --5vNYLRcllDrimb99 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXItPTAAoJEGw4ysog2bOSZ/QQAMho4jhGCljnNtu/pfEd1RPH IGLbI25qXu4MIij9weBBKG/+AlRwpwQ4PHRbMDlxEJwWCjwunumN3kIIILqMyDpD GoNOjgC+DR2PKPjzNDEmhZTcemFNZ3ddBk7Vjn20caViy3IKG3MDfpkjCZa+lSPX 2ZviPDjEkpzfUNOPrK30D93bEusbeehoZLlhMPsUn6XGXFZ14E2GBbYmcD9mmEeP CakaQuONXA9pLe1V/tPtmaRbis1vwQPdvFYx2siD2cDKVvCFu2Uc+YFHvBQZUdPP 1ww4Z7Y/ONElXpnhtwZr7x95C6QfiPxtMZNNUv+fWT3Z+RbZjjcdPYc06+kVErDp qlTZN8dmMYhctj8eGM5awD3UoNGzVMakYvm73sWfzGfnrSVpmDcuFtoSrjFeImcm BBZS8X/pFP8FwiJj9YHTrFbTb1wn47K0Opnk4sqBY4C8KoNuKeoT13mFnq2dcmaa nWt4X0c0h1973lDT/fJF8ChC/dhc04GvP7JXmNtzyzddOw0gBKKPyHVo7QpjfeOk 2YmQlHCJ901fF2IXNk2sLT4v8577ps8uEVnBw9kwwDM+licAxN3HE4/2IDf2a/g6 y2RyiFymJ/T/Eyu6/XIUtsTGzFTvNSygbKQvgGsASKGQMCEeLq8Qct6hTL2su9k/ vRExOFK0iQQtGALoVerp =9Rfd -----END PGP SIGNATURE----- --5vNYLRcllDrimb99--