diff options
author | 2009-10-04 14:16:07 +0200 | |
---|---|---|
committer | 2009-10-04 14:26:31 +0200 | |
commit | 249cdd049c7976614ad46eb86409d5e1e53835cc (patch) | |
tree | d6cb259c91ab5f7af94d1b8c4bdb05e240ef555a /exec.c | |
parent | Merge branch 'upstream-merge' (diff) | |
download | qemu-kvm-249cdd049c7976614ad46eb86409d5e1e53835cc.tar.gz qemu-kvm-249cdd049c7976614ad46eb86409d5e1e53835cc.tar.bz2 qemu-kvm-249cdd049c7976614ad46eb86409d5e1e53835cc.zip |
ksm support
Call madvise(MADV_MERGEABLE) on the memory allocations to allow the
kernel to merge them.
Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |