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

Fixed cgroup2 path issue in LXC-Top #4439

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DevonSchwartz
Copy link

We implimented some of the functionality to convert the cgroup paths to cgroup2 paths. However, we do not know how to tell whether system is using cgroup or cgroup2. In addition, some of the paths for cgroup did not have cgroup2 equivalents in the incus directory.

fix #4376

@lxc-jenkins
Copy link

This pull request didn't trigger Jenkins as its author isn't in the allow list.

An organization member must perform one of the following:

  • To have this branch tested by Jenkins, use the "ok to test" command.
  • To have a one time test done, use the "test this please" command.

Those commands are simple Github comments of the format: "jenkins: COMMAND"

@stgraber
Copy link
Member

stgraber commented May 1, 2024

This pull request has a bunch of changes to unrelated files, you probably want to clean that up.

@DevonSchwartz
Copy link
Author

Just cleaned up the file. I am now going to implement calling cgroup2 paths first and then cgroup afterwards.

@DevonSchwartz
Copy link
Author

Added cgroup2 and cgroup functionality so that warnings are not encountered. If any of the cgroup2 stat calls return an error code, then we call the cgroup container statistics.

@stgraber
Copy link
Member

stgraber commented May 2, 2024

The PR needs to be rebased as it's incorrectly reverting some changes now.

I also think it'd be best to have each individual metric attempt cgroup2 and fallback to cgroup1 as the current logic you have will fail if you're on a system that's cgroup2 but is somehow missing swap accounting, it will then assume it's cgroup1 and will fail even more as none of those files will be found.

@DevonSchwartz
Copy link
Author

I'll go ahead and push a commit to resolve the conflict in network.c. I must have accidentally reverted to a change before the latest commit to main that fixed a network.c issue.

@DevonSchwartz
Copy link
Author

Just rebased and unstaged irrelevant file changes.

@stgraber
Copy link
Member

stgraber commented May 3, 2024

Looks reasonable to me. Can you do a rebase to turn this whole thing into a single commit which also has the Closes #4376 line so it closes the issue?

@mihalicyn can you review?

Closes lxc#4376

Signed-off-by: Devon Schwartz <devon.s.schwartz@utexas.edu>
@DevonSchwartz
Copy link
Author

Looks reasonable to me. Can you do a rebase to turn this whole thing into a single commit which also has the Closes #4376 line so it closes the issue?

@mihalicyn can you review?

Awesome! I squashed into one commit and added the closing line.

@DevonSchwartz DevonSchwartz changed the title Completed two helper functions for lxc-top issue. Some cgroup1 do not… Fixed cgroup2 path issue in LXC-Top May 5, 2024
algitbot pushed a commit to alpinelinux/aports that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

lxc-top does not work with openrc and cgroup2 (Alpine Linux)
4 participants