From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44786 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaatS-0006lP-Fz for qemu-devel@nongnu.org; Wed, 05 Jan 2011 16:27:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaatR-0008Lj-5u for qemu-devel@nongnu.org; Wed, 05 Jan 2011 16:27:42 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:50864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaatQ-0008La-Qo for qemu-devel@nongnu.org; Wed, 05 Jan 2011 16:27:41 -0500 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e35.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p05LEU3b007259 for ; Wed, 5 Jan 2011 14:14:30 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p05LRcil158078 for ; Wed, 5 Jan 2011 14:27:38 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p05LRcs3015347 for ; Wed, 5 Jan 2011 14:27:38 -0700 Message-ID: <4D24E249.2040501@linux.vnet.ibm.com> Date: Wed, 05 Jan 2011 15:27:37 -0600 From: Michael Roth MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] add MADV_DONTFORK to guest physical memory References: <20100915170824.GL5981@random.random> <20110105151012.GC15823@random.random> <4D24B22C.4010302@linux.vnet.ibm.com> <20110105195430.GF15823@random.random> <4D24D3EB.1080702@linux.vnet.ibm.com> <20110105203518.GH15823@random.random> In-Reply-To: <20110105203518.GH15823@random.random> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrea Arcangeli Cc: Blue Swirl , =?ISO-8859-1?Q?Andreas_F=E4rber?= , "qemu-devel@nongnu.org Developers" , Anthony Liguori , Alexander Graf On 01/05/2011 02:35 PM, Andrea Arcangeli wrote: > On Wed, Jan 05, 2011 at 02:26:19PM -0600, Michael Roth wrote: >> Yah you're right, but I've seen several discussions about using mempath >> for tmpfs/ram-backed files for things like numa/zram/etc so tend to >> think of it as something potentially more than just a hook for >> hugetlbfs, which is becoming less and less useful. But the MADV_DONTFORK >> stuff should still be immediately applicable. > > Yes, MADV_DONTFORK should be set all on all guest physical memory > without options so I hope the new patch I just posted is fine to stop > the spurious -ENOMEM failures in fork. The patch in this thread? A couple paths still aren't covered when using -mem-path. Something like this should get them all: diff --git a/exec.c b/exec.c index 49c28b1..cbdcb16 100644 --- a/exec.c +++ b/exec.c @@ -2853,6 +2853,9 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, #endif qemu_madvise(new_block->host, size, QEMU_MADV_MERGEABLE); } + + /* no allocation failures during fork/exec for migrate/hotplug */ + qemu_madvise(new_block->host, size, QEMU_MADV_DONTFORK); }