Linux telemetry: record cgroup memory reclaim and device I/O #3661

Open
ghptc wants to merge 1 commit from upstream-pr/3661 into main
ghptc commented 2026-11-30 03:13:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-30T03:13:47Z.


What changes

The out-of-process Linux cgroup sampler now includes memory.stat and io.stat in each CSV sample. This makes it possible to compare memory classes, refaults and writeback with per-device I/O in the same sampling interval. The fields preserve the kernel's keys and units and use the sampler's existing | separator for multi-line values.

If the I/O controller is absent, io_stat is unavailable and the existing errors field continues to describe failures of the required reads. The sampler still opens the controller files read-only relative to the pinned cgroup directory. Credit #1162 for the sampler and #1426 for the separate retention probe's use of memory-class and refault counters.

Validation

Both tests in test_cgroup_sample.py passed. They cover missing I/O with partial controller reads, decoding multiple I/O device lines in the CSV, and removal and replacement of the observed cgroup.

A read-only smoke test sampled a real cgroup v2 without the I/O controller and its nearest ancestor with block I/O records. Both produced a sample and a final row with the expected memory keys and no collection errors. The child reported unavailable; the ancestor emitted per-device counters.

This is host telemetry. Runtime behavior, cgroup settings and game performance were outside the scope of the change and tests.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5558304663 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3661). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-30T03:13:47Z. --- ## What changes The out-of-process Linux cgroup sampler now includes `memory.stat` and `io.stat` in each CSV sample. This makes it possible to compare memory classes, refaults and writeback with per-device I/O in the same sampling interval. The fields preserve the kernel's keys and units and use the sampler's existing `|` separator for multi-line values. If the I/O controller is absent, `io_stat` is `unavailable` and the existing `errors` field continues to describe failures of the required reads. The sampler still opens the controller files read-only relative to the pinned cgroup directory. Credit #1162 for the sampler and #1426 for the separate retention probe's use of memory-class and refault counters. ## Validation Both tests in `test_cgroup_sample.py` passed. They cover missing I/O with partial controller reads, decoding multiple I/O device lines in the CSV, and removal and replacement of the observed cgroup. A read-only smoke test sampled a real cgroup v2 without the I/O controller and its nearest ancestor with block I/O records. Both produced a sample and a final row with the expected memory keys and no collection errors. The child reported `unavailable`; the ancestor emitted per-device counters. This is host telemetry. Runtime behavior, cgroup settings and game performance were outside the scope of the change and tests.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3661:upstream-pr/3661'
git switch 'upstream-pr/3661'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3661'
git switch 'upstream-pr/3661'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3661'
git switch 'upstream-pr/3661'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3661'
git switch 'main'
git merge --squash 'upstream-pr/3661'
git switch 'main'
git merge --ff-only 'upstream-pr/3661'
git switch 'main'
git merge 'upstream-pr/3661'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!3661
No description provided.