FRIDAY, APRIL 17, 2026
elf — Proposed
Support THP segment load with madvise enabled THP
This patch enables THP segment loading when THP is enabled with madvise in the kernel.
This patch modifies the ELF loader to support Transparent Huge Pages (THP) when THP is enabled with madvise in the kernel. It removes _dl_map_segment_align, calls _dl_map_segment_adjust to align THP-eligible PT_LOAD segments, and calls madvise with MADV_HUGEPAGE on those segments.
Technical Tradeoffs
- Requires changes to the dynamic linker to handle madvise-based THP.
- Adds complexity to the ELF loading process.