[PATCH v4] elf: Support THP segment load with madvise enabled THP

Carlos O'Donell carlos@redhat.com
Mon Apr 20 13:15:25 GMT 2026


On 4/18/26 11:15 PM, H.J. Lu wrote:
> Changes from v3:
> 
> 1. Fold the -z separate-code linker option check.
> 2. Move DL_MAP_DEFAULT_THP_PAGESIZE to <hugepages.h>
> and default it to 0.
> 3. Don't run strace tests for cross-compiling.
> 4. Remove return after FAIL_UNSUPPORTED in THP test.
> 
> Changes from v2:
> 
> 1.  Keep _dl_map_segment_align name.
> 2.  Pass size_t to _dl_map_segment_align.
> 3.  Enable THP if THP is always enabled in the kernel.
> 4.  Disable THP if THP page size > MAX_THP_PAGESIZE
> 
> Changes from v1:
> 
> 1. Rebased against the v10 THP test patch from WANG Rui <wangrui@loongson.cn>.
> 2. Keep DL_MAP_DEFAULT_THP_PAGESIZE.
> 

This has a 32-bit Arm regression:
https://patchwork.sourceware.org/project/glibc/patch/CAMe9rOqKfFXMDY07GRuppudP3V9fsCDXoyxDesPMNQLDrRhzvg@mail.gmail.com/

Produces 4 regressions:
   |
   | regressions.sum:
   | Running glibc:elf ...
   | FAIL: elf/tst-thp-1-no-s-code-pde
   | FAIL: elf/tst-thp-1-no-s-code-static
   | FAIL: elf/tst-thp-1-pde
   | FAIL: elf/tst-thp-1-static

I know you're already in discussions with Linaro about this issue.

Please be aware that the Linaro report should have all the information you need.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list