mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2501] [CLOSED] resident: fix budget clamp double-counting the pre-claimed arena #4080
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#4080
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/2501
Author: @G0-0000
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:resident-clamp-claim-fix📝 Commits (1)
32100bfresident: fix budget clamp double-counting the pre-claimed arena📊 Changes
1 file changed (+19 additions, -0 deletions)
View changed files
📝
src/core/expert_source.cpp(+19 -0)📄 Description
Bug
With the NUMA pre-claim path (
--numa-hot-node),reserve_resident_arena()faults the whole--resident-budget-gibarena into the cgroup'scurrentbeforepin_cache_complement()reads available memory. The clamp (clamp_resident_budget) then charges the budget for its own arena — the same RAM counted once as "used" and again as "to allocate".Measured on a Tesla V100-SXM2-32GB (UD-Q4_K_XL, 71.73 GiB of experts, 48.22 GiB RAM complement, cgroup MemoryMax 100 GiB, 125.76 GiB host):
42.75 < 48.22, so 5.08 GiB of experts stayed file-backed although the host had ~50 GiB free.
Fix
Add the not-yet-used claim back to the available-memory reading — the reading the clamp would have taken had it run before the claim. The credit is zero when no arena was claimed, so the non-arena path is byte-identical. A new log line prints the accounting (
reading + claim = available − headroom − margin → granted).Measured, after the fix
--drop-file-cachefires at last (see #2243 — it was gated off in every partial-residency run)Discussion (not in this PR)
Once the budget covers the whole complement, the file tier is never read at runtime, so its page cache is dead weight. We load with
STRATA_UNBUFFERED_LOAD=1(O_DIRECT), which removed the remaining ~43 GiB of load-time cache pollution for us. Arguably, unbuffered load should be the default when--resident-budget-gibcovers the full complement — happy to follow up with a measured PR if you agree.Dependency and validation
Depends on #2242: arena_preclaim_ is introduced there, so this PR cannot build standalone against main until #2242 merges. Please do not merge this PR first. The fix plus credit regression tests were integrated LOCALLY on #2242 head f2ab2310; CUDA sm_70 strata and file_expert_source_test built, and CPU-only test passed with active NUMA credit assertions. These tests are NOT YET in this PR branch; I will update it once #2242 merges. HIP/SYCL and GPU runtime not tested.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.