feat: add swapOnlyUsage in MemoryStats#4010
feat: add swapOnlyUsage in MemoryStats#4010lifubang merged 1 commit intoopencontainers:mainfrom HeRaNO:use-peak
swapOnlyUsage in MemoryStats#4010Conversation
|
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 |
lifubang
left a comment
There was a problem hiding this comment.
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 |
kolyshkin
left a comment
There was a problem hiding this comment.
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 <heran55@126.com>
|
All checks pass now. Ready to merge. |
implement #4000