[PATCH v6 5/6] elf: Align large load segments to PMD huge page size for THP

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Mar 9 17:36:07 GMT 2026


Hi Adhemerval,

> There is also the potential memory usage increase of using this tunable as
> default, as we saw a report for the malloc one on AArch64.  I think it would
> less than the malloc, but on multi-layer environment with a lot of process
> this could compound to a significant value.
>
> I think we should *not* make this the default for now.

Would it round up a 33MB load segment to 64MB? If so, that could increase
memory usage if you had lots of processes of that size. However the OS could
trivially drop any readonly hugepage at the first hint of memory pressure and
revert to base pages. So the fallback mechanism should be pretty robust.

If this feature is no longer experimental, is there really an issue with enabling
it by default on Loongarch? The performance results posted [1] look very good.

[1] https://sourceware.org/pipermail/libc-alpha/2026-March/175741.html

Cheers,
Wilco


More information about the Libc-alpha mailing list