Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mem high watermark reporting #502

Merged
merged 4 commits into from
Dec 15, 2023
Merged

Conversation

tomkinsc
Copy link
Member

@tomkinsc tomkinsc commented Dec 15, 2023

cgroup memory stats can be in one of several (at least three) locations depending on the version of cgroups in play and the docker backend. This PR updates reporting of peak memory used in tasks to account for three location possibilities.

This fixes reporting of the high water mark for memory usage within tasks:

previously we were examining /sys/fs/cgroup/memory/memory.max_usage_in_bytes at the end of tasks to report the max memory used during execution. This is only available under cgroup v1, and fails under cgroup v2. Previously there was not an equivalent under cgroup v2, however as of May 2022 an equivalent is available as /sys/fs/cgroup/memory/memory.peak

See:
torvalds/linux@8e20d4b
https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files
Copy link
Member

@dpark01 dpark01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so long as this is field tested, looks good to me

@dpark01 dpark01 enabled auto-merge December 15, 2023 18:20
@dpark01 dpark01 added this pull request to the merge queue Dec 15, 2023
Merged via the queue into master with commit d659825 Dec 15, 2023
12 checks passed
@dpark01 dpark01 deleted the ct-fix-mem-highwatermark-inspection branch December 15, 2023 18:45
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