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

Message ID 20260721200148.1706264-1-xry111@xry111.site (mailing list archive)
State Changes Requested
Headers
Series tests: Align THP tests to the 32MB huge-page size |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 fail Test failed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Xi Ruoyao July 21, 2026, 8:01 p.m. UTC
  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(-)
  

Comments

Andreas K. Huettel July 22, 2026, 9:23 a.m. UTC | #1
Am Mittwoch, 22. Juli 2026, 05:01:38 Japanische Normalzeit schrieb Xi Ruoyao:
> 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.

Let's not do this now anymore, however simple it may be.

(More likely to agree with an arch-specific fix for now, if it's absolutely
necessary for the release (which it isnt).)

> 
> 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
>
  
Xi Ruoyao July 22, 2026, 11:33 a.m. UTC | #2
On Wed, 2026-07-22 at 18:23 +0900, Andreas K. Huettel wrote:
> Am Mittwoch, 22. Juli 2026, 05:01:38 Japanische Normalzeit schrieb Xi Ruoyao:
> > 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.
> 
> Let's not do this now anymore, however simple it may be.

Moved to "Deferred to next release" on wiki.
  

Patch

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