-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: add swapOnlyUsage
in MemoryStats
#4010
Conversation
Thanks for your contribution. Please use |
done |
And could you see runc/libcontainer/cgroups/fs2/memory.go Lines 105 to 114 in b137e99
|
|
Can we have a test? |
Sure, added. |
@haircommander @lifubang @AkihiroSuda PTAL, thx |
Please squash commits |
LGTM |
@kolyshkin PTAL, thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we have accepted the ‘swapOnlyUsage’ approach, so please add some descriptions in ‘libcontainer/README.md’ to make each memory stat field more clear to the users.
memory.peak
and memory.swap.peak
in cgroups v2swapOnlyUsage
in MemoryStats
I've added some explanation in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. LGTM
This field reports swap-only usage. For cgroupv1, `Usage` and `Failcnt` are set by subtracting memory usage from memory+swap usage. For cgroupv2, `Usage`, `Limit`, and `MaxUsage` are set. This commit also export `MaxUsage` of memory under cgroupv2 mode, using `memory.peak` introduced in kernel 5.19. Signed-off-by: Heran Yang <[email protected]>
All checks pass now. Ready to merge. |
implement #4000