hugepage allocation failed (startup after a shutdown)

ferociousmilkyway

Well-Known Member
Aug 2, 2018
42
2
48
113
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!