keephugepages doesn't work

Kodey

Member
Oct 26, 2021
109
5
23
When a vm with pre allocated hugepages is put to sleep, the memory isn't kept and it can no longer be booted after a while and backup fails too.
Normally, it runs fine from boot concerning huge pages and no issues present, but if I shutdown or sleep and leave it for some time, it won't restart.
qm[1123132]: start failed: hugepage allocation failed at /usr/share/perl5/PVE/QemuServer/Memory.pm line 541.
 
Code:
 grep -i huge /proc/meminfo
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:      64
HugePages_Free:       63
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB
Hugetlb:        67108864 kB

I need a workaround to clear it so I don't need to reboot the host
 
Last edited:
You need to find out which process holds that one page.

edit:

Code:
grep huge /proc/*/numa_maps

should help
 
Last edited:
That helps
Code:
ps -f $(grep huge /proc/*/numa_maps | xargs -0 | sed -E 's/\/proc\/|\/numa_maps.*//g' | xargs )
UID          PID    PPID  C STIME TTY      STAT   TIME CMD
ctxroot    25151   14289  0 Aug31 ?        Ss     0:03 /usr/sbin/apache2 -k start
presta-+  354411   25151  0 10:00 ?        S      0:00 /usr/sbin/apache2 -k start
presta-+  354412   25151  0 10:00 ?        S      0:00 /usr/sbin/apache2 -k start
presta-+  354413   25151  0 10:00 ?        S      0:00 /usr/sbin/apache2 -k start
presta-+  354414   25151  0 10:00 ?        S      0:00 /usr/sbin/apache2 -k start
presta-+  354415   25151  0 10:00 ?        S      0:00 /usr/sbin/apache2 -k start

After I worked out which container it was and shut it down, I could boot the vm.

So why does this happen and how can I prevent it in the future?
 

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!