Skip to content

feat: add huge pages check - #26

Merged
jasper9 merged 3 commits into
mainfrom
jgray/hugepages-check
Oct 28, 2026
Merged

jasper9 merged 3 commits into
mainfrom
jgray/hugepages-check

Conversation

@jasper9

@jasper9 jasper9 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New hugepages check verifies huge pages are both configured and active:
    • GRUB_CMDLINE_LINUX_DEFAULT contains hugepagesz=<size> (exact) and hugepages=<count> (minimum), matched as whole tokens so hugepages=2560 isn't mistaken for 256
    • /sys/kernel/mm/hugepages/hugepages-<size>kB/nr_hugepages on the running kernel meets the minimum (catches GRUB edited but not applied / not rebooted). sysfs is used instead of /proc/meminfo because meminfo only reports the default page size.
    • Reports pages in use and agave-validator's share (informational, never fails), e.g. INFO: 2M huge pages in use: 32/256 (agave-validator: 64 MB). Warns (does not fail) if the pool is fully used. The process is matched by exact name so solana-validator-ha isn't counted.
  • Configurable via systemChecks.memory.hugepageSize (default 2M) and hugepageCount (default 256); toggle with checksToRun.hugepages
  • grubCmdline now also requires transparent_hugepage=never (separate commit d7b01a5, easy to drop)
  • Bug fix: get_config only scanned 20 lines after "checksToRun", so requiredPackages and grubCmdline silently ignored false. It now scans to the block's closing brace.
  • README and CLAUDE.md updated

Field data behind the thresholds

  • val-62 (hugepages on, Agave with --xdp-interface running): 256 reserved, 32 in use, all by agave-validator (64 MB)
  • val-59 (hugepages removed, Agave stopped): 0 reserved, so the new check fails as intended
  • Both hosts boot with transparent_hugepage=never, so the reserved pool is the only source of huge pages

Testing

  • shellcheck -S warning clean; config.json validates with jq
  • Ran check_hugepages against stubbed grub/sysfs/proc files: correct values, lowercase 2m, count too low, hugepages=2560, wrong size (1G), params missing, GRUB set but 0 allocated, val-62's real numbers (32/256), pool exhausted, Agave stopped
  • Confirmed grubCmdline: false is now honored (was ignored before)
  • Not yet run end to end on a live host

🤖 Generated with Claude Code

Verify hugepagesz/hugepages are set in GRUB_CMDLINE_LINUX_DEFAULT and
that the running kernel has allocated the pages. Size (default 2M) and
minimum count (default 256) are configurable under systemChecks.memory.

Also fix get_config only scanning 20 lines of checksToRun, which made
requiredPackages and grubCmdline impossible to disable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🤖 Codex Review

No findings.

jasper9 and others added 2 commits October 28, 2026 14:29
Print pages in use alongside the agave-validator process's share
(matched by exact name so solana-validator-ha is not counted). Usage is
informational only since a stopped validator, or one without XDP,
legitimately uses none; a warning is shown if no pages are free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validators reserve explicit huge pages instead of relying on THP; fleet
hosts already set this, but nothing checked it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🤖 Codex Review

Medium: health_check.sh:2062: The new transparent_hugepage=never check uses substring matching, so values like transparent_hugepage=neverfoo can pass even though they do not set the required kernel parameter; match complete command-line tokens and the exact value.

@jasper9
jasper9 merged commit 0889785 into main Oct 28, 2026
9 checks passed
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