From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSvj1-0003ur-D4 for qemu-devel@nongnu.org; Mon, 08 Feb 2016 19:00:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSviy-0005WU-Nr for qemu-devel@nongnu.org; Mon, 08 Feb 2016 19:00:11 -0500 Date: Tue, 9 Feb 2016 09:30:04 +1000 From: David Gibson Message-ID: <20160208233004.GA29288@voom.bne.redhat.com> References: <1454638439-11938-1-git-send-email-david@gibson.dropbear.id.au> <1454638439-11938-5-git-send-email-david@gibson.dropbear.id.au> <56B81D22.7080908@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <56B81D22.7080908@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH 4/6] pseries: Move hash page table allocation to reset time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 08, 2016 at 03:44:18PM +1100, Alexey Kardashevskiy wrote: > On 02/05/2016 01:13 PM, David Gibson wrote: > >At the moment the size of the hash page table (HPT) is fixed based on the > >maximum memory allowed to the guest. As such, we allocate the table dur= ing > >machine construction, and just clear it at reset. > > > >However, we're planning to implement a PAPR extension allowing the hash > >page table to be resized at runtime. This will mean that on reset we wa= nt > >to revert it to the default size. It also means that when migrating, we > >need to make sure the destination allocates an HPT of size matching the > >host, since the guest could have changed it before the migration. > > > >This patch replaces the spapr_alloc_htab() and spapr_reset_htab() functi= ons > >with a new spapr_reallocate_hpt() function. This is called at reset and > >inbound migration only, not during machine init any more. >=20 >=20 > I'd suggest splitting this patch in two (move spapr_hpt_shift_for_ramsize= to > a new patch, or reorganizing it somehow (move spapr_hpt_shift_for_ramsize= to > a different place) - this one is really hard to read and make sure that > nothing is lost. Good idea, I'll do that. > >In addition, we add a new helper to compute the recommended hash table s= ize > >for a given RAM size. We export this as well as spapr_reallocate_hpt(), > >since we'll be needing them elsewhere in future. >=20 > Do you already have a patch in your queue to exploit this? >=20 > I was told few times to export stuff when I have to... True, I'll look at that again. --=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 --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWuST8AAoJEGw4ysog2bOS0J0P/0baXZeETXNZ67TIw89o4zlo aGnmUeirAH0i8djdLDAFNmMuz6HcftqPvOraXZNNbJ/GQNBOOciGhOico5NOvK9W +EQJWpTOfsx/+LDWpwidU/23grXjLqfNiTq+PEZKJC1SvjiW2uYTDv2GsjdZj8YI FpayeD+jU8DcG2N2ZbpjwBpdVN79nEbe/5+9rWA1WQzCc7qrRBBAqd6pmt+lO6FA PKhPZ8AKwTUS5N2ty0fTm8y7Lg+b/ys1eDQppiuFUDiThNV9aoDbjMAtoLAqFZbV wDENym5A+Alci4+qxuNIHr3/1uf7UsZwDOW8UlTAaKA7Dt0EeEULtguumSFqdleb Mfu8YesUprD0G7AKwI6a/p/0i/5p1ZZW9KbtEmL5q6wayzLYvK5FspZWNLXBHXbm mMX3zekrcOb7LHqPBvM8aWzojNFv8GYWAqZ1z4a1CiFXtlzjKYBm2BKNQf/ZZ9vx aQ8cAJ8mDa8keVjxx+P4ib8/7EXBLe1+Grxs27DPjtAisfcr3kub9VHR0YyY5rT3 C2vITtWRlfvZikDeqMVF5rmGtTRXi0hB6H+S/9Hr6b2i5Fvgg/H8KGag/wHZkjCP c/pVwoAwIkfai5NSJx+5coXudUhL1rF16gq4nHBZT35KEk2THAaVvIGKEvBZc99E yKMNjBQWhkTCHNajelTy =H0+X -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o--