提交 ccb167e9 编写于 作者: I Izik Eidus 提交者: Anthony Liguori

ksm support

Call MADV_MERGEABLE on guest memory allocations.  MADV_MERGABLE will be
available starting in Linux 2.6.32.  This system call registers a region of
virtual address space with Linux as a candidate for transparent memory
sharing.

Patchworks-ID: 35447
Signed-off-by: NIzik Eidus <ieidus@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 de41ac92
......@@ -2412,6 +2412,9 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size)
new_block = qemu_malloc(sizeof(*new_block));
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册