Describe the bug
A clear and concise description of what the bug is.
Without explicit huge pages, the VM memory is only aligned to 4 KiB. This means that the entire VM is likely to only get 4 KiB EPT entries, instead of 2 MiB or 1 GiB. This leads to reduced memory performance due to TLB pressure.
I have a PR to expose an option for alignment in vm-memory here: rust-vmm/vm-memory#375
To Reproduce
Steps to reproduce the behaviour:
Launch any VM with N GiB of memory, with or without THP. Observe that (unless you get lucky), /sys/kernel/debug/kvm/pages_2m is 0.
From looking at the code, I observed that QEMU and OpenVMM do align their memory.
Version
Output of cloud-hypervisor --version:
v51.1
Did you build from source, if so build command line (e.g. features):
No
VM configuration
What command line did you run (or JSON config data):
Launch a VM with a decent amount of memory (512 MiB, 1 GiB+), with THP but not explicit huge pages.
Guest OS version details:
https://github.com/cloud-hypervisor/linux
Host OS version details:
Observed on Azure Linux, Ubuntu 20, and Amazon Linux 3.
Logs
N/A, let me know if needed
Output of cloud-hypervisor -v from either standard error or via --log-file:
Linux kernel output:
Ditto
Describe the bug
A clear and concise description of what the bug is.
Without explicit huge pages, the VM memory is only aligned to 4 KiB. This means that the entire VM is likely to only get 4 KiB EPT entries, instead of 2 MiB or 1 GiB. This leads to reduced memory performance due to TLB pressure.
I have a PR to expose an option for alignment in
vm-memoryhere: rust-vmm/vm-memory#375To Reproduce
Steps to reproduce the behaviour:
Launch any VM with N GiB of memory, with or without THP. Observe that (unless you get lucky),
/sys/kernel/debug/kvm/pages_2mis 0.From looking at the code, I observed that QEMU and OpenVMM do align their memory.
Version
Output of
cloud-hypervisor --version:v51.1
Did you build from source, if so build command line (e.g. features):
No
VM configuration
What command line did you run (or JSON config data):
Launch a VM with a decent amount of memory (512 MiB, 1 GiB+), with THP but not explicit huge pages.
Guest OS version details:
https://github.com/cloud-hypervisor/linux
Host OS version details:
Observed on Azure Linux, Ubuntu 20, and Amazon Linux 3.
Logs
N/A, let me know if needed
Output of
cloud-hypervisor -vfrom either standard error or via--log-file:Linux kernel output:
Ditto