Skip to content

PS-10595 [trunk]: Add innodb_large_page_populate to control huge page pre-population#6055

Open
polchawa-percona wants to merge 1 commit into
percona:trunkfrom
polchawa-percona:PS-10595-trunk-large-page-populate
Open

PS-10595 [trunk]: Add innodb_large_page_populate to control huge page pre-population#6055
polchawa-percona wants to merge 1 commit into
percona:trunkfrom
polchawa-percona:PS-10595-trunk-large-page-populate

Conversation

@polchawa-percona

@polchawa-percona polchawa-percona commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

https://perconadev.atlassian.net/browse/PS-10595

This patch is a contribution from Alexey Bychko abychko@gmail.com.

Introduce a new InnoDB boolean system variable innodb_large_page_populate
(Linux only) that controls whether huge pages and page-aligned allocations
used by the buffer pool and the page allocator are pre-populated at
allocation time.

When OFF (default), large_page_aligned_alloc() and page_aligned_alloc()
skip MAP_POPULATE and the explicit prefault step by masking the caller's
populate request with the global flag. This reduces startup time and
NUMA-related overhead on large systems with huge pages. When ON, the
previous behavior (honor the caller's populate request) is preserved.

The backing global is named srv_large_page_populate, following the srv_
naming convention used by other InnoDB globals. On non-Linux platforms the
flag is a compile-time constant true, so behavior there is unchanged.

Buffer pool memory is only reserved at buf_pool_init() time; actual
physical allocation happens on first page fault. Huge pages are never
migrated by the kernel's NUMA balancer, and the NUMA interleave memory
policy is only a hint honored at fault time: if a node is briefly out of
free memory when a page is first touched, the page lands on a different
node and stays there permanently, skewing the buffer pool's NUMA placement
for the life of the server. To guard against this, a startup warning is
emitted when innodb_numa_interleave and large_pages are both enabled
while innodb_large_page_populate is OFF, suggesting to drop the page
cache before starting mysqld and to enable innodb_large_page_populate
in that configuration so pages are faulted in immediately under the
interleave policy.

@polchawa-percona polchawa-percona force-pushed the PS-10595-trunk-large-page-populate branch from 248b8db to 6e5e3b0 Compare July 3, 2026 08:47
… pre-population

https://perconadev.atlassian.net/browse/PS-10595

This patch is a contribution from Alexey Bychko <abychko@gmail.com>.

Introduce a new InnoDB boolean system variable innodb_large_page_populate
(Linux only) that controls whether huge pages and page-aligned allocations
used by the buffer pool and the page allocator are pre-populated at
allocation time.

When OFF (default), large_page_aligned_alloc() and page_aligned_alloc()
skip MAP_POPULATE and the explicit prefault step by masking the caller's
populate request with the global flag. This reduces startup time and
NUMA-related overhead on large systems with huge pages. When ON, the
previous behavior (honor the caller's populate request) is preserved.

The backing global is named srv_large_page_populate, following the srv_
naming convention used by other InnoDB globals. On non-Linux platforms the
flag is a compile-time constant true, so behavior there is unchanged.

Buffer pool memory is only reserved at buf_pool_init() time; actual
physical allocation happens on first page fault. Huge pages are never
migrated by the kernel's NUMA balancer, and the NUMA interleave memory
policy is only a hint honored at fault time: if a node is briefly out of
free memory when a page is first touched, the page lands on a different
node and stays there permanently, skewing the buffer pool's NUMA
placement for the life of the server. To guard against this, a startup
warning is emitted when innodb_numa_interleave and large_pages are both
enabled while innodb_large_page_populate is OFF, suggesting to drop the
page cache before starting mysqld and to enable innodb_large_page_populate
in that configuration so pages are faulted in immediately under the
interleave policy.
@polchawa-percona polchawa-percona force-pushed the PS-10595-trunk-large-page-populate branch from 6e5e3b0 to e6a1dd6 Compare July 8, 2026 09:15
@polchawa-percona polchawa-percona requested review from satya-bodapati and removed request for percona-ysorokin July 14, 2026 13:20
@polchawa-percona polchawa-percona self-assigned this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant