-
Notifications
You must be signed in to change notification settings - Fork 251
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
cgroups/cgfsng: improve swap accounting support detection #663
Merged
Conversation
This file contains 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
When LXCFS daemon runs in a root cgroup of cgroup2 tree, we need to go down the tree when checking for memory.swap.current. We already have some logic to go up the tree from LXCFS daemon's cgroup, but it's useless when LXCFS daemon sits in the cgroup2 tree root. Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Just for reference, these days it not possible to disable swap accounting on memcg: |
brauner
approved these changes
Oct 2, 2024
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.
This won't handle the case where no cgroup exists in /sys/fs/cgroup/
at all but that's extremely unlikely so I'm not sure it's worth worrying about.
mihalicyn
added a commit
to mihalicyn/lxd-ci
that referenced
this pull request
Oct 2, 2024
Older LXCFS versions (4.0.x and 5.0.x branches) do not handle swap accounting on cgroup2 properly. While we are improving cgroup2 tests for a newer LXD versions we don't want to make tests red on the older ones. So, let's check if LXCFS declares support for swap accounting and only in this case make any checks for it. See also: lxc/lxcfs#663 Signed-off-by: Alexander Mikhalitsyn <[email protected]>
mihalicyn
added a commit
to mihalicyn/lxd-ci
that referenced
this pull request
Oct 2, 2024
Older LXCFS versions (4.0.x and 5.0.x branches) do not handle swap accounting on cgroup2 properly. While we are improving cgroup2 tests for a newer LXD versions we don't want to make tests red on the older ones. So, let's check if LXCFS declares support for swap accounting and only in this case make any checks for it. See also: lxc/lxcfs#663 Signed-off-by: Alexander Mikhalitsyn <[email protected]>
mihalicyn
added a commit
to mihalicyn/lxd-ci
that referenced
this pull request
Oct 2, 2024
Older LXCFS versions (4.0.x and 5.0.x branches) do not handle swap accounting on cgroup2 properly. While we are improving cgroup2 tests for a newer LXD versions we don't want to make tests red on the older ones. So, let's check if LXCFS declares support for swap accounting and only in this case make any checks for it. See also: lxc/lxcfs#663 Signed-off-by: Alexander Mikhalitsyn <[email protected]>
hamistao
pushed a commit
to hamistao/lxd-ci
that referenced
this pull request
Oct 10, 2024
Older LXCFS versions (4.0.x and 5.0.x branches) do not handle swap accounting on cgroup2 properly. While we are improving cgroup2 tests for a newer LXD versions we don't want to make tests red on the older ones. So, let's check if LXCFS declares support for swap accounting and only in this case make any checks for it. See also: lxc/lxcfs#663 Signed-off-by: Alexander Mikhalitsyn <[email protected]>
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.
When LXCFS daemon runs in a root cgroup of cgroup2 tree, we need to go down the tree when checking for memory.swap.current.
We already have some logic to go up the tree from LXCFS daemon's cgroup, but it's useless when LXCFS daemon sits in the cgroup2 tree root.