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);
     }

Reply via email to