-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Following up on besser82/libxcrypt#152 (which is fixed):
Maybe we need to also consider madvise for maybe-better performance on recent kernels in default configuration:
https://twitter.com/epcjones/status/1615890036720893954
https://www.evanjones.ca/hugepages-are-a-good-idea.html
"The Linux kernel's implementation of transparent huge pages has been the source of performance problems. When introduced, it was initially enabled for all processes and memory regions by default. This caused a large number of problems, which eventually caused the kernel's default to change to madvise, where programs have to opt-in to use huge pages (see Nelson Elhage's summary (2017), and Ubuntu bug that changed the default (2017/released 2019).
The performance problems are rare high latency (e.g. operations being substantially slower than normal), throughput issues due to excess CPU consumption of the kernel background tasks, or substantial increases in memory usage."
Indeed, transparent huge pages are expected to be slower than explicit ones, but for this usage could still be faster than default page size after a certain allocation size threshold. This needs testing with a variety of kernel versions, hardware, sizes.