Let's say I mount hugepages at /mnt/hugepages; and then two applications open() and then mmap() to the same hugepage.
After one crashes, another close() and then munmap(), I noticed the hugepage is still allocated inside /mnt/hugepages, numastat -vm also shows that a hugepage is occupied. Then, I manually delete that file (/hugepage), numastat -vm still shows a hugepage is occupied. Then, I killed the remaining application. Finally, numastat -vm shows the hugepage is no longer occupied.
Now my question is what is the proper way to release the hugepage in this case without killing all the applications previously mmap-ed the page?
I did read this post.
But my post is different that I don't want to kill all the applications but release the hugepage asap and I don't want to unmount.
Thanks!