aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2014-04-24 18:10:04 +0100
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:39:55 +0100
commitcdd823c4ce760a4af7420f0ddf6d565c219a0dcf (patch)
tree1e270622c1ea18cf1808fbe41dde61ffe3301b96
parentb4d9ac641b07294d99305242b3fada88eb37065d (diff)
downloadkvmtool-cdd823c4ce760a4af7420f0ddf6d565c219a0dcf.tar.gz
kvmtool: ARM: pass MADV_HUGEPAGE to madvise
If the host kernel is configured with CONFIG_TRANSPARENT_HUGEPAGE_MADVISE, it is important to madvise(MADV_HUGEPAGE) the memory region. Otherwise, the guest won't benefit from using THP. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--arm/kvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arm/kvm.c b/arm/kvm.c
index d0d64ff7..58ad9fa2 100644
--- a/arm/kvm.c
+++ b/arm/kvm.c
@@ -79,7 +79,7 @@ void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size)
SZ_2M);
madvise(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size,
- MADV_MERGEABLE);
+ MADV_MERGEABLE | MADV_HUGEPAGE);
/* Initialise the virtual GIC. */
if (gic__init_irqchip(kvm))