diff mbox

PATCH: kvm-userspace: ksm support

Message ID 20091004141607.549fe80a@woof.woof (mailing list archive)
State New, archived
Headers show

Commit Message

Izik Eidus Oct. 4, 2009, 12:16 p.m. UTC
None
diff mbox

Patch

diff --git a/exec.c b/exec.c
index 5c9edf7..406d2cb 100644
--- a/exec.c
+++ b/exec.c
@@ -2538,6 +2538,9 @@  ram_addr_t qemu_ram_alloc(ram_addr_t size)
     new_block->host = file_ram_alloc(size, mem_path);
     if (!new_block->host) {
         new_block->host = qemu_vmalloc(size);
+#ifdef MADV_MERGEABLE
+        madvise(new_block->host, size, MADV_MERGEABLE);
+#endif
     }
     new_block->offset = last_ram_offset;
     new_block->length = size;