[PATCH] tests: Align THP tests to the 32MB huge-page size

Xi Ruoyao xry111@xry111.site
Tue Jul 21 20:01:38 GMT 2026


On MIPS64 and AArch64 systems with 16-KiB pages, the PMD size is 32MB.
As we already have multiple platforms requiring such a large size, it
seems easier to raise the default instead of adding more special cases.

Link: https://sourceware.org/glibc/wiki/Testing/Tests/elf/tst-thp-1
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---

Tested on x86_64-linux and mips64-linux.

 sysdeps/unix/sysv/linux/Makefile           | 4 ++--
 sysdeps/unix/sysv/linux/loongarch/Makefile | 3 ---
 sysdeps/unix/sysv/linux/sparc/Makefile     | 5 -----
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 14a56d5cc3..9d3608c352 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -733,8 +733,8 @@ endif
 ifndef THP-PAGE-SIZE
 # Align PT_LOAD segments in THP tests to THP page size so that kernel will
 # map PIE to the address aligned to THP page size.  Default THP page size
-# to 2MB which can be overridden in Makefile in subdirectories.
-THP-PAGE-SIZE = 0x200000
+# to 32MB which can be overridden in Makefile in subdirectories.
+THP-PAGE-SIZE = 0x2000000
 endif
 
 THP-PAGE-SIZE-CFLAGS = -DTHP_PAGE_SIZE=$(THP-PAGE-SIZE)
diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile
index d5beb62440..0d5f087862 100644
--- a/sysdeps/unix/sysv/linux/loongarch/Makefile
+++ b/sysdeps/unix/sysv/linux/loongarch/Makefile
@@ -12,6 +12,3 @@ abi-ilp32s-condition	:= __WORDSIZE == 32 && defined __loongarch_soft_float
 abi-ilp32d-condition	:= __WORDSIZE == 32 && defined __loongarch_double_float
 abi-lp64s-condition	:= __WORDSIZE == 64 && defined __loongarch_soft_float
 abi-lp64d-condition	:= __WORDSIZE == 64 && defined __loongarch_double_float
-
-# Align THP tests to 32MB.
-THP-PAGE-SIZE = 0x2000000
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
index 57e73d0a14..e0056c9413 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -14,8 +14,3 @@ endif
 ifeq ($(subdir),signal)
 sysdep_routines += sigreturn_stub
 endif
-
-ifeq ($(subdir),elf)
-# The sparc64 uses an 8KB base page and 8MB PMD transparent huge page
-THP-PAGE-SIZE = 0x800000
-endif
-- 
2.55.0



More information about the Libc-alpha mailing list