Skip to content

Dashboard: HugePages reads red when enabled but unused (0 in use) — should be green #175

@VijitSingh97

Description

@VijitSingh97

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

  1. build/dashboard/mining_dashboard/collector/system.pyget_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
  2. 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.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdashboardMining dashboard web UIwave-3-dashboardv1.0 Wave 3: dashboard showcase polish (parallel track)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions