[PATCH 0/2] LoongArch64: Align large code segments to 32MB for THP
WANG Rui
wangrui@loongson.cn
Tue Feb 24 07:48:27 GMT 2026
On LoongArch64, using 16K normal pages means the PMD huge page size is
32M. Mapping code segments that are 32M or larger to 32M-aligned address
helps make them eligible for THP.
This patch changes the segment mapping logic for segments with a zero
vaddr and a zero offset. When running on LP64 with a 16K page size, if
an executable segment's size is greater than or equal to 32M, we
explicitly set its alignment to 32M. This optimization improves TLB
usage and execution performance for large objects.
WANG Rui (2):
LoongArch: Add architecture-specific dl-map-segments.h
LoongArch64: Align large code segments to 32MB for THP
.../sysv/linux/loongarch/dl-map-segments.h | 245 ++++++++++++++++++
1 file changed, 245 insertions(+)
create mode 100644 sysdeps/unix/sysv/linux/loongarch/dl-map-segments.h
--
2.53.0
More information about the Libc-alpha
mailing list