summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-10-05 16:47:57 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2012-10-22 13:26:34 -0500
commitad0b5321f1f797274603ebbe20108b0750baee94 (patch)
treed66e04150cabc509f915b1ac7b13de163457816f /exec.c
parentf526f3c315d7c3ff7b7db39ae3a49f91d3a9986b (diff)
downloadqemu-ad0b5321f1f797274603ebbe20108b0750baee94.zip
Call MADV_HUGEPAGE for guest RAM allocations
This makes it possible for QEMU to use transparent huge pages (THP) when transparent_hugepage/enabled=madvise. Otherwise THP is only used when it's enabled system wide. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index c4ed6fdef1..750008c4e1 100644
--- a/exec.c
+++ b/exec.c
@@ -2571,6 +2571,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
cpu_physical_memory_set_dirty_range(new_block->offset, size, 0xff);
qemu_ram_setup_dump(new_block->host, size);
+ qemu_madvise(new_block->host, size, QEMU_MADV_HUGEPAGE);
if (kvm_enabled())
kvm_setup_guest_memory(new_block->host, size);