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

Rework cgroup detection #269

Merged
merged 1 commit into from
Sep 5, 2021
Merged

Rework cgroup detection #269

merged 1 commit into from
Sep 5, 2021

Conversation

Furisto
Copy link
Collaborator

@Furisto Furisto commented Sep 5, 2021

The original implementation assumed that cgroup v1 und cgroup v2 could be used side by side, but resource controllers are either attached to the one or the other. A system supports one of three modes (if it is systemd based):

  • Legacy: pure v1
  • Unified: pure v2
  • Hybrid: v1, but with some v2 features activated. Resource control needs to be done with v1 as all controllers are attached to the v1 hierarchy. Going forward, this mode will not be available anymore.

One can check which filesystems are mounted where in order to determine in which mode the system is (see code comments).

@utam0k
Copy link
Member

utam0k commented Sep 5, 2021

I have a feeling that when using cgroup v2, the values need to be converted just like crun, is that a problem?
https://github.com/containers/crun/blob/main/crun.1.md#cgroup-v2

@Furisto
Copy link
Collaborator Author

Furisto commented Sep 5, 2021

Cpu is converted here, but memory doesn't seem to be converted. I will fix this in another PR...

Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Furisto Furisto force-pushed the cg-detect branch 2 times, most recently from 6ee0831 to 1dbf88d Compare September 5, 2021 15:25
@Furisto Furisto merged commit 8330a03 into youki-dev:main Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants