hugepage allocation failed (startup after a shutdown)

ferociousmilkyway

Well-Known Member
Aug 2, 2018
42
2
48
114
Hello,

I've recently begun using the "hugepages: any" setting in my pci passthrough VM's, and I'm seeing improved DPC latency results and general performance.

VM's will always start from a fresh boot with with this flag, but after a shutdown and start up of a "hugepages: any" VM, I often see the following error:

start failed: hugepage allocation failed at /usr/share/perl5/PVE/QemuServer/Memory.pm line 532.

Once this occurs, the VM will not start unless I remove the "hugepages" conf setting, or reboot the whole VM server. My system supports and allocates 1GB hugepages with the "any" setting.

I have no supporting GRUB statements, and besides this issue, it's working great.

It seems that KVM/QEMU is not releasing the hugepages on shutdown?

Any help greatly appreciated! Thanks for the awesome OS.
 
we write 0 to /sys/kernel/mm/hugepages/hugepages-${SIZE}/nr_hugepages which should release them after the vm is shutdown
of course you could be unlucky and the memory fragmentation does not allow for a 1gb hugepage to be allocated again
 
Got the same experience! Works at first, all good, then it stops, need to reboot the pve node..
 
Same here... is there any way to get around this?
Funny thing is, sometime I can restart the VM dozen of times and sometimes not even once