Huge Pages
Cheat sheet · https://pcornel.dk/topic.php?topic=3495
Answer
Huge pages back VM memory with 2 MB or 1 GB pages instead of 4 KB, reducing TLB misses and page-table overhead for large or latency-sensitive VMs. They cannot be swapped or shared, so they reduce overcommit flexibility.
Remember
- Huge pages are reserved and not swappable.
- Allocate at boot to avoid fragmentation.
- Wrong count wastes RAM.
First checks
grep -i hugepages /proc/meminfo— reserved/free huge pagescat /sys/kernel/mm/transparent_hugepage/enabled— THP modevirsh dumpxml <vm> | grep hugepages— VM uses huge pages
Commands
qm set 101 --hugepages 1024
Verify in this order
reserved pages → VM backing
Where it usually breaks
First mismatch in host capability/IOMMU/NUMA → hypervisor allocation/mapping → virtual hardware model → guest driver/enumeration → workload use; preserve identity/native error/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3495