[1.1] libct/cg/fs2: use file + anon + swap for usage#3977
Merged
mrunalp merged 1 commit intoopencontainers:release-1.1from Aug 10, 2023
Merged
[1.1] libct/cg/fs2: use file + anon + swap for usage#3977mrunalp merged 1 commit intoopencontainers:release-1.1from
file + anon + swap for usage#3977mrunalp merged 1 commit intoopencontainers:release-1.1from
Conversation
Contributor
Author
Contributor
Author
|
@AkihiroSuda I know you had hesitation on the other PR, but I think the differences qualify as a bug and that justifies including it in 1.1 (especially so kubernetes can vendor it before 1.2 is released) |
kolyshkin
approved these changes
Aug 9, 2023
Contributor
kolyshkin
left a comment
There was a problem hiding this comment.
LGTM.
Yes, I think this backport is needed, as it solves a real problem.
mrunalp
approved these changes
Aug 9, 2023
AkihiroSuda
approved these changes
Aug 9, 2023
Contributor
|
Let's merge it after #3976 so we can run CI on go 1.21. |
This aligns v2 usage calculations more closely with v1. Current node-level reporting for v1 vs v2 on the same machine under similar load may differ by ~250-750Mi. Also return usage as combined swap + memory usage, aligned with v1 and non-root v2 cgroups. `mem_cgroup_usage` in the kernel counts NR_FILE_PAGES + NR_ANON_MAPPED + `nr_swap_pages` (if swap enabled) [^0]. Using total - free results in higher "usage" numbers. This is likely due to various types of reclaimable memory technically counted as in use (e.g. inactive anon). See also kubernetes/kubernetes#118916 for more context [^0]: https://github.com/torvalds/linux/blob/06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5/mm/memcontrol.c#L3673-L3680 Signed-off-by: Alexander Eldeib <alexeldeib@gmail.com>
Contributor
|
Rebased on top of #3976 to check against updated CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #3933 by @alexeldeib to release-1.1 branch. Original description follows.
This aligns v2 usage calculations more closely with v1. Current node-level reporting for v1 vs v2 on the same machine under similar load may differ by ~250-750Mi.
Also return usage as combined swap + memory usage, aligned with v1 and non-root v2 cgroups.
mem_cgroup_usagein the kernel counts NR_FILE_PAGESnr_swap_pages(if swap enabled) 1.Using total - free results in higher "usage" numbers. This is likely due to various types of reclaimable memory technically counted as in use (e.g. inactive anon).
See also kubernetes/kubernetes#118916 for more context
Footnotes
https://github.com/torvalds/linux/blob/06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5/mm/memcontrol.c#L3673-L3680 ↩