Skip to content

fix(tune): runtime HugePages reservation is grow-only (#328) - #329

Merged
VijitSingh97 merged 2 commits into
developfrom
fix/328-hugepages-grow-only
Aug 1, 2026
Merged

fix(tune): runtime HugePages reservation is grow-only (#328)#329
VijitSingh97 merged 2 commits into
developfrom
fix/328-hugepages-grow-only

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

What

tune_kernel's runtime sysctl wrote the miner's computed requirement absolutely, shrinking a pool another consumer already reserved (a co-hosted Pithead stack's p2pool/monerod live in the same 2MB pool) down to its in-use floor — zero free pages on both sides, measured live during the pithead#797 R0 appliance recon (details in #328).

Now the write is availability-based and grow-only: pages the miner can draw on = HugePages_Free + pages a running miner already holds; the pool grows by the shortfall only and never shrinks. This is the runtime half of #305's co-resident keep-existing guard, and it applies with or without hugepages_reserve_extra_mb.

  • Fresh single-purpose rig: identical behavior to before (plain requirement written).
  • Co-hosted box: the other consumer's reservation survives; the pool becomes the sum only when genuinely short.
  • Idempotent: re-runs that find enough available write nothing; a running miner's held pages count as available (it re-uses them across a restart), so setup re-runs while mining don't grow the pool unboundedly.
  • setup --dry-run previews the same decision via the same availability check.

Verified

Closes #328

🤖 Generated with Claude Code

VijitSingh97 and others added 2 commits July 31, 2026 23:08
tune_kernel wrote the miner's computed requirement to vm.nr_hugepages
absolutely, which shrinks a pool another consumer already reserved (a
co-hosted pithead stack's p2pool/monerod share the same 2MB pool) down
to its in-use floor — zero free pages on both sides, measured live on
the pithead#797 appliance bench.

The write is now availability-based: pages the miner can draw on =
HugePages_Free + whatever a running miner already holds (it re-uses its
pages across a restart). The pool grows by the shortfall only and never
shrinks. Fresh single-purpose rigs see the same reservation as before;
re-runs that find enough available write nothing. This is the runtime
half of #305's co-resident keep-existing guard. The setup --dry-run
plan previews the same decision from the same availability check.

Closes #328

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ge branches

Three lines diff-cover flagged: the real-MainPID HugetlbPages read (now
exercised via a stub systemctl reporting a live pid), the no-proposed-grub
3072 fallback (now asserted grow-only too), and the dry-run plan's
covered-pool wording. The probe also always prints a number now — a status
file without a HugetlbPages line previously produced empty output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 merged commit c383b03 into develop Aug 1, 2026
9 checks passed
@VijitSingh97
VijitSingh97 deleted the fix/328-hugepages-grow-only branch August 1, 2026 04:23
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.

tune_kernel's runtime HugePages write shrinks another consumer's pool — reserve grow-only

1 participant