(1) Allocate large pages on host $ echo 1054 > /proc/sys/vm/nr_hugepages Rationale for the above '1024' value from here: http://www.linux-kvm.org/page/UsingLargePages "On x86, large pages are 2M, so determine the max size of the guest, and with some fudge factor (about 30 pages, completely arbitrary value); we have something like: HPAGES = $(($GUEST_SIZE_IN_MB / 2) + 30) For example, a 2G guest would yield 1054 2MB pages." (2) `meminfo` *before* booting the guest $ grep -i Huge /proc/meminfo AnonHugePages: 0 kB HugePages_Total: 1054 HugePages_Free: 1054 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB (3) Invoke QEMU with this minimal CLI: ----------------------------------------------------------------------- #!/bin/bash set -x qemu-system-x86_64 \ -m 2048 \ -mem-prealloc \ -mem-path /dev/hugepages/libvirt/qemu \ -nographic \ -nodefconfig \ -nodefaults \ -machine accel=kvm \ -cpu host \ -device virtio-scsi-pci,id=scsi \ -serial stdio \ -drive file=/var/lib/libvirt/images/f21vm.qcow2,format=qcow2,cache=writeback ----------------------------------------------------------------------- (4) meminfo` *after* booting the guest $ grep -i Huge /proc/meminfo AnonHugePages: 0 kB HugePages_Total: 1054 HugePages_Free: 851 HugePages_Rsvd: 821 HugePages_Surp: 0 Hugepagesize: 2048 kB