From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP8WP-00051Y-MC for qemu-devel@nongnu.org; Mon, 18 Jul 2016 09:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP8WL-00059I-3a for qemu-devel@nongnu.org; Mon, 18 Jul 2016 09:23:44 -0400 Received: from 5.mo178.mail-out.ovh.net ([46.105.51.53]:46995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP8WK-000596-Oc for qemu-devel@nongnu.org; Mon, 18 Jul 2016 09:23:41 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id D37CA1010408 for ; Mon, 18 Jul 2016 15:23:39 +0200 (CEST) Date: Mon, 18 Jul 2016 15:23:32 +0200 From: Greg Kurz Message-ID: <20160718152332.3c21263e@bahia.lan> In-Reply-To: <20160718124409.62e06fb2@bahia.lan> 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> <20160718124409.62e06fb2@bahia.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/rZ=S4CgQM6I4xWyE=ZxVq9d"; 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson --Sig_/rZ=S4CgQM6I4xWyE=ZxVq9d Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 18 Jul 2016 12:44:09 +0200 Greg Kurz wrote: > On Mon, 18 Jul 2016 11:33:16 +0200 > Thomas Huth wrote: >=20 > > On 18.07.2016 11:26, Greg Kurz wrote: =20 > > > 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 avai= lable > > >>>>> for main RAM") already made sure that huge page support is not an= nounced > > >>>>> to the guest if the normal RAM of non-NUMA configurations is not = backed > > >>>>> by a huge page filesystem. However, there is one more case that c= an go > > >>>>> wrong: NUMA is enabled, but the RAM of the NUMA nodes are not con= figured > > >>>>> with huge page support (and only the memory of a DIMM is configur= ed with > > >>>>> it). When QEMU is started with the following command line for exa= mple, > > >>>>> the Linux guest currently crashes because it is trying to use hug= e pages > > >>>>> on a memory region that does not support huge pages: > > >>>>> > > >>>>> qemu-system-ppc64 -enable-kvm ... -m 1G,slots=3D4,maxmem=3D32G -= object \ > > >>>>> memory-backend-file,policy=3Ddefault,mem-path=3D/hugepages,siz= e=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 su= pport, > > >>>>> too, when there is a NUMA node that is not using a memory backend= with > > >>>>> 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 = though :) =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= the > > >> exact command line to trigger that assertion? > > >> =20 > > >=20 > > > I hit the assertion when I specify pc-dimm devices on the command lin= e: > > >=20 > > > qemu-system-ppc64 -enable-kvm ... -m 2G,slots=3D4,maxmem=3D32G \ > > > -object memory-backend-file,policy=3Ddefault,mem-path=3D/mnt/kvm_hug= epage,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=3D= 1G,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: ca= n't > > use already busy memdev: mem-mem1 > >=20 > > Thomas > > =20 >=20 > I hit the assertion with this exact command line: >=20 > qemu-system-ppc64 -machine pseries,accel=3Dkvm \ > -m 1G,slots=3D4,maxmem=3D32G \ > -object memory-backend-file,policy=3Ddefault,mem-path=3D/dev/hugepages,si= ze=3D1G,id=3Dmem-mem1 \ > -device pc-dimm,id=3Ddimm-mem1,memdev=3Dmem-mem1 \ > -numa node,nodeid=3D0,memdev=3Dmem-mem1 \ > -S >=20 > QEMU was built against David's ppc-for-2.7 branch (commit 159d2e39a). >=20 > But I get the very same error as you with QEMU 2.6... regression ? >=20 Bisect leads to: commit 2aece63c8a9d2c3a8ff41d2febc4cdeff2633331 Author: Xiao Guangrong Date: Wed Jul 13 12:18:06 2016 +0800 hostmem: detect host backend memory is being used properly ... any idea ? > And BTW, I'm not sure to understand why it is wrong to specify both pc-di= mm and > numa pointing to the same memory backend. >=20 > Cheers. >=20 > -- > Greg --Sig_/rZ=S4CgQM6I4xWyE=ZxVq9d Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAleM2FQACgkQAvw66wEB28Jk5gCfZVsZNHc4dKu4cDNVDTlVcpy5 Be8AoJM+W7oax8dLnoSmxGcHZ+8hUUHV =Sisg -----END PGP SIGNATURE----- --Sig_/rZ=S4CgQM6I4xWyE=ZxVq9d--