[PATCH v2 3/4] elf: Align large load segments to PMD huge page size for THP

Florian Weimer fweimer@redhat.com
Thu Feb 26 13:23:07 GMT 2026


* Adhemerval Zanella Netto:

>> diff --git a/sysdeps/unix/sysv/linux/wordsize-64/dl-map-segment-align.c b/sysdeps/unix/sysv/linux/wordsize-64/dl-map-segment-align.c
>> new file mode 100644
>> index 0000000000..3c57d593bd
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/wordsize-64/dl-map-segment-align.c
>
> Move this to sysdeps/unix/sysv/linux/dl-map-segment-align.c; I think this
> should be a generic change and it should be applicable to 32-bit as
> well (and I would prefer to avoid adding wordsize-64 definitions, it
> complicated the syscalls defintions a lot).

I think this should be LoongArch-specific for now because I don't think
there is sufficient commonality among MMU implementations (and I'm not
sure how unified the THP implementation in the Linux kernel is today).
The alignment heuristic may only be applicable to LoongArch.

But maybe the heuristic applies to all relevant AArch64 implementation
as-is?  That would be surprising to me.

Thanks,
Florian



More information about the Libc-alpha mailing list