From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP62F-0003zP-BI for qemu-devel@nongnu.org; Mon, 18 Jul 2016 06:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP62B-00053U-4K for qemu-devel@nongnu.org; Mon, 18 Jul 2016 06:44:27 -0400 Received: from 5.mo178.mail-out.ovh.net ([46.105.51.53]:41249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP62A-00053I-Qu for qemu-devel@nongnu.org; Mon, 18 Jul 2016 06:44:23 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id 33B1510043B5 for ; Mon, 18 Jul 2016 12:44:21 +0200 (CEST) Date: Mon, 18 Jul 2016 12:44:09 +0200 From: Greg Kurz Message-ID: <20160718124409.62e06fb2@bahia.lan> In-Reply-To: <928de718-79e1-9c8a-a05d-ed51e1e31a05@redhat.com> References: <1468570225-14101-1-git-send-email-thuth@redhat.com> <20160718005236.GD16769@voom.fritz.box> <20160718105944.3908f7ca@bahia.lan> <9c8dae5e-d2bd-fa21-f12e-31fd21ca97bc@redhat.com> <20160718112650.4f831dd3@bahia.lan> <928de718-79e1-9c8a-a05d-ed51e1e31a05@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/bkCK6MKs3x1vCEwRcvJ2Q/n"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: Yet another fix for the huge page support detection mechanism List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --Sig_/bkCK6MKs3x1vCEwRcvJ2Q/n Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 18 Jul 2016 11:33:16 +0200 Thomas Huth wrote: > On 18.07.2016 11:26, Greg Kurz wrote: > > On Mon, 18 Jul 2016 11:04:39 +0200 > > Thomas Huth wrote: > > =20 > >> On 18.07.2016 10:59, Greg Kurz wrote: =20 > >>> On Mon, 18 Jul 2016 10:52:36 +1000 > >>> David Gibson wrote: > >>> =20 > >>>> On Fri, Jul 15, 2016 at 10:10:25AM +0200, Thomas Huth wrote: =20 > >>>>> Commit 86b50f2e1bef ("Disable huge page support if it is not availa= ble > >>>>> for main RAM") already made sure that huge page support is not anno= unced > >>>>> to the guest if the normal RAM of non-NUMA configurations is not ba= cked > >>>>> by a huge page filesystem. However, there is one more case that can= go > >>>>> wrong: NUMA is enabled, but the RAM of the NUMA nodes are not confi= gured > >>>>> with huge page support (and only the memory of a DIMM is configured= with > >>>>> it). When QEMU is started with the following command line for examp= le, > >>>>> the Linux guest currently crashes because it is trying to use huge = pages > >>>>> on a memory region that does not support huge pages: > >>>>> > >>>>> qemu-system-ppc64 -enable-kvm ... -m 1G,slots=3D4,maxmem=3D32G -ob= ject \ > >>>>> memory-backend-file,policy=3Ddefault,mem-path=3D/hugepages,size= =3D1G,id=3Dmem-mem1 \ > >>>>> -device pc-dimm,id=3Ddimm-mem1,memdev=3Dmem-mem1 -smp 2 \ > >>>>> -numa node,nodeid=3D0 -numa node,nodeid=3D1 > >>>>> > >>>>> To fix this issue, we've got to make sure to disable huge page supp= ort, > >>>>> too, when there is a NUMA node that is not using a memory backend w= ith > >>>>> huge page support. > >>>>> > >>>>> Fixes: 86b50f2e1befc33407bdfeb6f45f7b0d2439a740 > >>>>> Signed-off-by: Thomas Huth > >>>>> --- > >>>>> target-ppc/kvm.c | 10 +++++++--- > >>>>> 1 file changed, 7 insertions(+), 3 deletions(-) =20 > >>>> > >>>> Applied to ppc-for-2.7, thanks. > >>>> =20 > >>> > >>> It looks like my replies to this patch were ignored... no big deal th= ough :) =20 > >> > >> I'll try to come up with an additional patch that fixes the remaining > >> problem that you've found... Meanwhile, did you find out why you get > >> that assertion that I was not able to recreate? Could you maybe post t= he > >> exact command line to trigger that assertion? > >> =20 > >=20 > > I hit the assertion when I specify pc-dimm devices on the command line: > >=20 > > qemu-system-ppc64 -enable-kvm ... -m 2G,slots=3D4,maxmem=3D32G \ > > -object memory-backend-file,policy=3Ddefault,mem-path=3D/mnt/kvm_hugep= age,size=3D1G,id=3Dmem-mem1 \ > > -device pc-dimm,id=3Ddimm-mem1,memdev=3Dmem-mem1 \ > > -object memory-backend-file,policy=3Ddefault,mem-path=3D/mnt,size=3D1G= ,id=3Dmem-mem2 \ > > -device pc-dimm,id=3Ddimm-mem2,memdev=3Dmem-mem2 \ > > -smp 2 -numa node,nodeid=3D0,memdev=3Dmem-mem1 \ > > -numa node,nodeid=3D1,memdev=3Dmem-mem2 =20 >=20 > FWIW, with that command line, I still don't get an assertion but a > normal error message: >=20 > qemu-system-ppc64: -device pc-dimm,id=3Ddimm-mem1,memdev=3Dmem-mem1: can't > use already busy memdev: mem-mem1 >=20 > Thomas >=20 I hit the assertion with this exact command line: qemu-system-ppc64 -machine pseries,accel=3Dkvm \ -m 1G,slots=3D4,maxmem=3D32G \ -object memory-backend-file,policy=3Ddefault,mem-path=3D/dev/hugepages,size= =3D1G,id=3Dmem-mem1 \ -device pc-dimm,id=3Ddimm-mem1,memdev=3Dmem-mem1 \ -numa node,nodeid=3D0,memdev=3Dmem-mem1 \ -S QEMU was built against David's ppc-for-2.7 branch (commit 159d2e39a). But I get the very same error as you with QEMU 2.6... regression ? And BTW, I'm not sure to understand why it is wrong to specify both pc-dimm= and numa pointing to the same memory backend. Cheers. -- Greg --Sig_/bkCK6MKs3x1vCEwRcvJ2Q/n Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAleMsvkACgkQAvw66wEB28JmTgCgiM2REulrHZPjWsKS5P+ddc1M 6k8An1e690Cn6mFbD60seyhNYMmvwhTj =s7CR -----END PGP SIGNATURE----- --Sig_/bkCK6MKs3x1vCEwRcvJ2Q/n--