[PATCH v10] elf: Add test for THP alignment of large load segments

Project / Subsystem

glibc / elf

Date

2026-04-17

Proposer

WANG Rui <[email protected]>

Source type

public_inbox

Consensus

Proposed

Sentiment

8/10

Technical tradeoffs

  • The test is skipped if the THP size cannot be determined or if THP is not enabled in "always" mode.
  • Adds a new test file and modifies the Makefile.

All attributes

project
glibc
subsystem
elf
patch_id
discussion_id
[email protected]
source_type
public_inbox
title
[PATCH v10] elf: Add test for THP alignment of large load segments
headline
Add test for THP alignment of large load segments
tldr
This patch adds a test to verify that large executable PT_LOAD segments are THP-aligned when glibc.elf.thp=1 and THP is in 'always' mode.
stakes
Ensures correct THP alignment for large executable segments, which can improve performance by reducing TLB misses.
proposer
WANG Rui <[email protected]>
consensus
Proposed
outcome
proposed
sentiment_score
8
sentiment_rationale
The patch adds a test, improving code quality. Version 10 suggests refinement and heading towards consensus.
technical_tradeoffs
  • The test is skipped if the THP size cannot be determined or if THP is not enabled in "always" mode.
  • Adds a new test file and modifies the Makefile.
series_id
series_role
standalone
series_parts
[]
tags
  • elf
  • THP
  • alignment
  • testing
  • PT_LOAD
bugzilla_url
date
2026-04-17T00:00:00.000Z

[PATCH v10] elf: Add test for THP alignment of large load segments

This patch adds a new test to verify that large executable PT_LOAD segments are mapped at addresses aligned to the THP size when the glibc tunable glibc.elf.thp=1 is enabled and the system is configured to use THP in “always” mode. The test loads a shared object and checks /proc/self/maps for THP alignment. The test skips if THP size is unavailable or not in “always” mode.