mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5394
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5341
Author: @qdotme
Created: 11/5/2026
Status: 🔄 Open
Base:
main← Head:f-055-arena-hugetlb📝 Commits (1)
41ec883arena: a reserved huge-page pool counts as the RAM the expert arena needs (#5317): the #4846 fallback weighed the arena against MemAvailable alone, so a host that reserved vm.nr_hugepages for it read as short on every start and took the file source while the pool sat unused (seen on a 125 GiB box with a 71.73 GiB arena: 123 GB read from storage in one request); the Linux probe now reads HugePages_Free x Hugepagesize, and a pool of the arena's size loads with a line naming the pool; the wait, the give-back and the fallback keep their rules when RAM and pool are both short, and a hard cgroup limit still governs. Tests: ple_residency_test 909 checks and file_expert_source_test pass; one engine built and run on Linux CUDA, HIP/SYCL not built here.📊 Changes
5 files changed (+69 additions, -29 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+3 -1)📝
include/strata/core/ple_residency.hpp(+11 -7)📝
src/core/expert_source.cpp(+34 -10)📝
src/core/ple_residency_test.cpp(+15 -11)📝
tests/core/file_expert_source_test.cpp(+6 -0)📄 Description
Problem and result
Problem (observed, reproduced locally): since #4846 the arena is priced against MemAvailable only. Reserved
vm.nr_hugepagespages are not in MemAvailable, so a host that reserved a pool exactly for the arena reads short on every start and takes the--mmap-expertsfile source while the pool sits unused. On this host (engine 0.1.56, Linux, 2x RTX 4090, 125 GiB RAM, nr_hugepages=36727, arena 71.73 GiB): not enough RAM for the expert arena (30.47 GiB short) → experts via mmap → 123–400 GB read from storage per request, VSZ 209 GiB, swap touched. Matches #5317's Docker report exactly.Result after the change: the reserved huge-page pool has 71.73 GiB free (vm.nr_hugepages), so the arena loads on 2 MB pages → cudaHostRegister PORTABLE ok; hugetlb 2 MB pages; HugePages_Free: 0, Private_Hugetlb: 71.7 GiB, VSZ 138 GiB, no workaround env, one completion verified end to end.
Related discussion
None
Approach
Approach: the Linux probe reads HugePages_Free × Hugepagesize beside MemAvailable; arena_ram_verdict loads when either alone covers the arena (MAP_HUGETLB is all-or-nothing at exactly the arena size, so a pool of the arena's size is the RAM). Pool short → wait, give-back and fallback are byte-identical to today. A hard cgroup limit still governs regardless of the pool.
Validation
Passed:
Validation — passed: ple_residency_test 909 checks (4 new pool checks incl. "cgroup limit beats the pool"); file_expert_source_test (3 new HugePages parse checks — one caught a parser bug in the first draft); engine 0.1.57 built at this rebase and run on the box above, before/after A/B as quoted.
Not run:
Validation — not run: HIP and SYCL builds (no toolchains here), a cgroup-limited container with a pool, Windows/macOS (field reads 0 by construction).
Limits
Default 2 MB page size only (a foreign Hugepagesize would need a MAP_HUGE_* flag the arena does not request); Linux reader, like the rest of the guard.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.