In earlier systems (CentOS 8) I was able to make an application run using huge pages for memory allocations by setting LD_LIBRARY_PATH=<path to libhugetlbfs.so.
I tried the same approach in Rocky Linux 9. However there is no libhugetlbfs package for el9. Instead I installed successfully an rpm I had for el8 (libhugetlbfs-2.21-17.el8.x86_64.rpm).
I tried running the binary as before:
LD_PRELOAD=/usr/lib64/libhugetlbfs.so ./brhclus <args>
However looking in /proc/meminfo as the program runs, I see no reserved huge pages
AnonPages: 52018332 kB
AnonHugePages: 0 kB
HugePages_Total: 614400
HugePages_Free: 614400
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 1258291200 kB
System
OS: Rocky Linux 9.2
Kernel: 5.14.0-284.18.1.el9_2.x86_64
Memory 1.5T
I may be missing something obvious – any ideas?
2
Answers
I found why this doesn't work. libhugetlbfs uses __morecore function in glibc which has been removed (?) or at least deprecated. As a solution I use transparent huge pages systemwide enabled using
I consider my question answered.
You can follow the documentation prepared by RHEL team here
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/monitoring_and_managing_system_status_and_performance/configuring-huge-pages_monitoring-and-managing-system-status-and-performance#configuring-hugetlb-at-boot-time_configuring-huge-pages