All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] add MADV_DONTFORK to guest physical memory
@ 2010-09-15 17:08 Andrea Arcangeli
  2010-09-15 17:34 ` Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Andrea Arcangeli @ 2010-09-15 17:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

From: Andrea Arcangeli <aarcange@redhat.com>

All allocated guest physical memory shall be marked MADV_DONTFORK, otherwise
fork will fail because of accounting issues preventing migration or netdev_add
when the guest allocated more than half of host physical memory.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---

diff --git a/exec.c b/exec.c
index 380dab5..e2bdf19 100644
--- a/exec.c
+++ b/exec.c
@@ -2861,6 +2861,9 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
 #ifdef MADV_MERGEABLE
             madvise(new_block->host, size, MADV_MERGEABLE);
 #endif
+#ifdef MADV_DONTFORK
+            madvise(new_block->host, size, MADV_DONTFORK);
+#endif
         }
     }
 

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-01-06 20:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-15 17:08 [Qemu-devel] [PATCH] add MADV_DONTFORK to guest physical memory Andrea Arcangeli
2010-09-15 17:34 ` Alexander Graf
2010-09-15 17:37 ` Andreas Färber
2011-01-05 15:10   ` Andrea Arcangeli
2011-01-05 18:02     ` Michael Roth
2011-01-05 19:44       ` Alexander Graf
2011-01-05 19:54         ` Andrea Arcangeli
2011-01-05 20:00           ` Alexander Graf
2011-01-05 20:12             ` Anthony Liguori
2011-01-05 20:15             ` Andrea Arcangeli
2011-01-05 20:26           ` Michael Roth
2011-01-05 20:35             ` Andrea Arcangeli
2011-01-05 21:27               ` Michael Roth
2011-01-06 17:49                 ` Andrea Arcangeli
2011-01-06 20:49                   ` Michael Roth
2011-01-05 20:10         ` Anthony Liguori
2010-09-15 21:03 ` [Qemu-devel] " Michael S. Tsirkin
2010-09-16  6:51   ` Gleb Natapov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.