4 ms·
> I'd have look into that. Off the top of my head I don't know how you'd make that happen. Pass these flags to your mmap call: (MAP_HUGETLB | MAP_HUGE_1GB)
by inetknght 1y ago
> I'd have look into that. Off the top of my head I don't know how you'd make that happen.
Pass these flags to your mmap call: (MAP_HUGETLB | MAP_HUGE_1GB)
- jared_hulbert 1y agoWould this actually create huge page page cache entries?
- inetknght 1y agoIt's right in the documentation for mmap() [0]! And, from my experience, using it with an 800GB file provided a significant speed-up, so I do believe the documentation is correct ;) And, you can poke around in the linux kernel's source code to determine how it works. I had a related issue that I ended up digging around to find the answer to: what happens if you use mremap() to expand the mapping and it fails; is the old mapping still valid or not? Answer: it's still valid. I found that it was actually fairly easy to read linux kernel C code, compared to a lot (!) of other C libraries I've tried to understand. [0]: https://www.man7.org/linux/man-pages/man2/mmap.2.html https://www.man7.org/linux/man-pages/man2/mmap.2.html