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

cgroups: pure v1, hybrid, pure v2 #10107

Closed
brauner opened this issue Sep 17, 2018 · 6 comments
Closed

cgroups: pure v1, hybrid, pure v2 #10107

brauner opened this issue Sep 17, 2018 · 6 comments
Milestone

Comments

@brauner
Copy link
Contributor

brauner commented Sep 17, 2018

Technically, this is neither a feature request nor a bug report. So sorry for that.

We currently support three different cgroup layouts:

  1. pure cgroup v1 layout
  2. hybrid layout
  3. pure cgroup v2 layout

I would like to propose an agreement for the way forward. :)

So, we all agree that cgroup v2 is going to be the future and that we are in the process of making userspace tools and libraries that we maintain compatible with it.

What would be nice though is if we could agree that the hybrid cgroup layout will only be supported when the cgroup v2 controller is mounted at /sys/fs/cgroup/unified and is empty, i.e. that we don't ever support having some controllers mounted into v1 hierarchies and some controllers mounted into v2 hierarchies. This is a level of complexity userspace and kernel wise that I would like to make sure to avoid. In short, hybrid mode should be considered to be somewhat in maintenance-only mode. I wasn't sure if we ever discussed this.

@floppym
Copy link
Contributor

floppym commented Sep 17, 2018

What would be nice though is if we could agree that the hybrid cgroup layout will only be supported when the cgroup v2 controller is That is fine and we (@lxc) at least have made appropriate preparations.

I'm having trouble parsing this sentence... copy/paste fail?

@brauner
Copy link
Contributor Author

brauner commented Sep 17, 2018

@floppym, yip, thanks for pointing it out. :) Should be fixed.

@evverx
Copy link
Member

evverx commented Sep 18, 2018

Just to complete the list, there is another layout called unified_systemd_v232, which is also hybrid and totally incompatible with everything else. I'm not sure anybody uses it in practice, but, it's probably worth noting that Debian Stretch comes with systemd-232. The good news is that it's very hard to accidentally start to use it there: https://salsa.debian.org/systemd-team/systemd/blob/stretch/debian/patches/core-don-t-use-the-unified-hierarchy-for-the-systemd-cgro.patch).

@poettering
Copy link
Member

Quite frankly at this point I think doing "hybrid" is a stopgap we should never have added... It blurs the road forward. People should either use full cgroupsv1 or full cgroupsv2 but anything in between is just a maintainance burden.

But anyway, that ship might have sailed, the code is in now.

What would be nice though is if we could agree that the hybrid cgroup layout will only be supported when the cgroup v2 controller is mounted at /sys/fs/cgroup/unified and is empty, i.e. that we don't ever support having some controllers mounted into v1 hierarchies and some controllers mounted into v2 hierarchies.

Yes, this is the intention and the only thing systemd supports. The hybrid mode is dumb and minimal. All it adds is the cgroupv2 core hierarchy itself, but controllers are not attached to it, and remain pinned to the classic cgroupsv1 mounts.

I'll prep a patch that clarifies this in docs/CGROUP_DELEGATION.md.

@poettering poettering added this to the v240 milestone Sep 24, 2018
@brauner
Copy link
Contributor Author

brauner commented Sep 24, 2018

@poettering, thanks for doing this! Excellent!

@poettering
Copy link
Member

Fix waiting in #10161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants