Re:Memory is slow, Disk is fast – Part 2
by vlovich123 on Friday September 05, 2025 @10:37AM
(#45139116)
The most common problem is the system not having any support for hugetable allocated. Don’t have the specific things that need to be configured handy.
> Huge page (Huge TLB) mappings
> For mappings that employ huge pages, the requirements for the arguments of mmap() and munmap() differ somewhat from the requirements for mappings that use the native system page size.
> For mmap(), offset must be a multiple of the underlying huge page size. The system automatically aligns length to be a multiple of the underlying huge page size.
Ensure that the file is at least the page size, and preferably sized to align with a page boundary. Then also ensure that the length parameter (size_bytes in your example) is also aligned to a boundary.
There are also other important things to understand for these flags, which are described in the documentation, such as information available from /sys/kernel/mm/hugepages
https://www.man7.org/linux/man-pages/man2/mmap.2.html