Skip to content

pmdalinux: fix mem.numa.hugepages on non-sequential NUMA node ids - #2700

Merged
natoscott merged 1 commit into
performancecopilot:mainfrom
kurik:ppc64le-huge
Aug 27, 2026
Merged

pmdalinux: fix mem.numa.hugepages on non-sequential NUMA node ids#2700
natoscott merged 1 commit into
performancecopilot:mainfrom
kurik:ppc64le-huge

Conversation

@kurik

@kurik kurik commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

refresh_sysfs_numa_hugepages() used the pmdaCache walk index as the NUMA node number when opening sysfs paths and building instance names. On ppc64le Power systems, firmware-assigned node ids are often non-sequential or omit node0, so the wrong directories were scanned and mem.numa.hugepages.* returned no values even when per-node hugepage sysfs entries existed.

Use pernode_t::nodeid from pmdaCacheLookup(), consistent with numa_meminfo.c. Add qa/linux/sysfs-hugepages-004.tgz exercising a node1-only layout and update qa/1788 expected output.

Resolves Red Hat bug RHEL-113057

refresh_sysfs_numa_hugepages() used the pmdaCache walk index as the
NUMA node number when opening sysfs paths and building instance names.
On ppc64le Power systems, firmware-assigned node ids are often
non-sequential or omit node0, so the wrong directories were scanned and
mem.numa.hugepages.* returned no values even when per-node hugepage
sysfs entries existed.
Use pernode_t::nodeid from pmdaCacheLookup(), consistent with
numa_meminfo.c. Add qa/linux/sysfs-hugepages-004.tgz exercising a
node1-only layout and update qa/1788 expected output.
Resolves Red Hat bug RHEL-113057
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: fcfdeb5b-3a74-42d3-aafb-5f516a3ee457

📥 Commits

Reviewing files that changed from the base of the PR and between 55365f2 and 201c535.

⛔ Files ignored due to path filters (1)
  • qa/1788.out is excluded by !**/*.out
📒 Files selected for processing (2)
  • qa/linux/sysfs-hugepages-004.tgz
  • src/pmdas/linux/sysfs_hugepages.c

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved NUMA hugepage discovery by using the correct NUMA node identifiers.
    • Skips unavailable NUMA entries to prevent incorrect paths and cache references.

Walkthrough

The NUMA hugepage refresh now resolves each cache entry to its pernode_t data. It skips unresolved entries and uses np->nodeid to build filesystem paths and cache prefixes.

Changes

NUMA hugepage refresh

Layer / File(s) Summary
Resolve NUMA node data and build identifiers
src/pmdas/linux/sysfs_hugepages.c
The refresh loop resolves each NUMA cache entry. It skips entries without valid node data. It uses np->nodeid instead of the cache iteration index for hugepage paths and cache prefixes.

Poem

A rabbit checks each NUMA node

Hugepage paths now bear the right code
Missing nodes hop out of sight
Resolved IDs keep caches right
Sysfs fields line up just so

Merge Risk: ⚪ Minimal · up to 201c5

This localized fix updates NUMA node handling and adds focused regression coverage; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for NUMA hugepages on systems with non-sequential NUMA node IDs.
Description check ✅ Passed The description directly explains the bug, the code change, the affected systems, and the added test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@natoscott
natoscott merged commit affa757 into performancecopilot:main Aug 27, 2026
1 of 14 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.

2 participants