From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH v3 3/3] tools/libxc: use superpages during restore of HVM guest Date: Fri, 25 Aug 2017 16:51:51 +0200 Message-ID: <20170825145151.GP6372@aepfle.de> References: <20170824101443.31345-1-olaf@aepfle.de> <20170824101443.31345-4-olaf@aepfle.de> <20170825120645.g2r5smkgfdxmorhc@citrix.com> <20170825125101.GN6372@aepfle.de> <20170825133604.tyjebwqdt5kuuiti@citrix.com> <20170825140015.GO6372@aepfle.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8137340026619411341==" Return-path: In-Reply-To: <20170825140015.GO6372@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu Cc: Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============8137340026619411341== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eBTWNsZZiigckDWV" Content-Disposition: inline --eBTWNsZZiigckDWV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Fri, Aug 25, Olaf Hering wrote: > I think with the new check of max_pages an overallocation can not happen > anymore. If at some point the domU still has room for a superpage, it > will be allocated. In case the batch does not fully fill the superpage, > the holes will be freed. In the next batch no superpage can be allocated > anymore, but single pages will be used. There is one case where Over-allocation will happen: assume x86_hvm_populate_pfns gets a batch of pfns that fit trigger the allocation of a 1G page. All pfns will fit into that partly populated superpage. Then the guest has a hole right after the max_pfn of that batch. The next batch will start in a new superpage. As a result the freeing part of x86_hvm_populate_pfns will not consider the previous superpage anymore. Now 512MB are allocated, but unpopulated. To handle this case the min_pfn/max_pfn have to be global so that the current batch can free allocated pfns from previous batches. Olaf --eBTWNsZZiigckDWV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSkRyP6Rn//f03pRUBdQqD6ppg2fgUCWaA5hAAKCRBdQqD6ppg2 frV7AJ9GMe+BkBuEFxm+pPjnKjMOHfJpIACguCH1+jTvAQLgxiVrzgQPFJz58Qw= =qBFO -----END PGP SIGNATURE----- --eBTWNsZZiigckDWV-- --===============8137340026619411341== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============8137340026619411341==--