Problem
When HugePages are enabled (HugePages_Total > 0) but none are in use yet (used == 0) — e.g. right after boot, or while Monero is still syncing and the miner is held — the dashboard header renders:
Huge Pages: Allocated (0 / 3072) ← in red
Red implies something is wrong, but nothing is: HugePages are correctly reserved; the miner simply isn't consuming them yet (it starts using them once mining begins). This is the normal startup / sync state, so it shouldn't read as an error.
Where it's coded
-
build/dashboard/mining_dashboard/collector/system.py → get_hugepages_status() already distinguishes three states:
total == 0 → ("Disabled", "status-bad", …) (genuinely off)
used > 0 → ("Enabled", "status-ok", …) (actively used)
total > 0 and used == 0 → ("Allocated", "status-warn", …) ← this case
-
build/dashboard/mining_dashboard/web/views.py (~L408) flattens the three-state into two:
"variant": "ok" if hp_class == "status-ok" else "bad",
so status-warn becomes bad.
-
build/dashboard/mining_dashboard/web/static/components.mjs:112 renders binary:
class=${s.hugepages.variant === 'ok' ? 'status-ok' : 'status-bad'}
→ bad → red. (A .status-warn amber class exists in dashboard.css but is never reached for HugePages because of the flatten + binary check.)
Desired
When HugePages are enabled (total > 0), the status should be green, even with used == 0. Reserve red for the only genuinely-bad case: total == 0 ("Disabled" / not enabled). "Allocated but not yet used" is expected, not an error.
Fix options
- Simplest (matches the ask): in
views.py, treat status-warn as ok for HugePages (or, in get_hugepages_status(), return status-ok for the total > 0, used == 0 case). Allocated → green; keep the "Allocated" vs "Enabled" label distinction if useful.
- Softer alternative: preserve the three-state and render
status-warn as amber instead of collapsing it — fix the views.py flatten and the binary check in components.mjs:112 to honor a warn variant. (Not red, not full green — "ready, not yet used".) Per the report, plain green is preferred.
Add/extend a unit test for get_hugepages_status() covering all three states, and assert the views.py mapping doesn't turn an enabled-but-unused node red.
Repro
Enable HugePages (GRUB hugepages=N + reboot) on a node while Monero is still syncing (miner held). Dashboard header shows "Huge Pages: Allocated (0 / N)" in red despite HugePages being correctly reserved.
Problem
When HugePages are enabled (
HugePages_Total > 0) but none are in use yet (used == 0) — e.g. right after boot, or while Monero is still syncing and the miner is held — the dashboard header renders:Red implies something is wrong, but nothing is: HugePages are correctly reserved; the miner simply isn't consuming them yet (it starts using them once mining begins). This is the normal startup / sync state, so it shouldn't read as an error.
Where it's coded
build/dashboard/mining_dashboard/collector/system.py→get_hugepages_status()already distinguishes three states:total == 0→("Disabled", "status-bad", …)(genuinely off)used > 0→("Enabled", "status-ok", …)(actively used)total > 0 and used == 0→("Allocated", "status-warn", …)← this casebuild/dashboard/mining_dashboard/web/views.py(~L408) flattens the three-state into two:so
status-warnbecomesbad.build/dashboard/mining_dashboard/web/static/components.mjs:112renders binary:→
bad→ red. (A.status-warnamber class exists indashboard.cssbut is never reached for HugePages because of the flatten + binary check.)Desired
When HugePages are enabled (
total > 0), the status should be green, even withused == 0. Reserve red for the only genuinely-bad case:total == 0("Disabled" / not enabled). "Allocated but not yet used" is expected, not an error.Fix options
views.py, treatstatus-warnasokfor HugePages (or, inget_hugepages_status(), returnstatus-okfor thetotal > 0, used == 0case). Allocated → green; keep the "Allocated" vs "Enabled" label distinction if useful.status-warnas amber instead of collapsing it — fix theviews.pyflatten and the binary check incomponents.mjs:112to honor awarnvariant. (Not red, not full green — "ready, not yet used".) Per the report, plain green is preferred.Add/extend a unit test for
get_hugepages_status()covering all three states, and assert theviews.pymapping doesn't turn an enabled-but-unused node red.Repro
Enable HugePages (
GRUB hugepages=N+ reboot) on a node while Monero is still syncing (miner held). Dashboard header shows "Huge Pages: Allocated (0 / N)" in red despite HugePages being correctly reserved.