Skip to content

cgroup2: use new fstype for unified hierarchy#2112

Closed
alban wants to merge 4 commits intosystemd:masterfrom
kinvolk:alban/cgroup2
Closed

cgroup2: use new fstype for unified hierarchy#2112
alban wants to merge 4 commits intosystemd:masterfrom
kinvolk:alban/cgroup2

Conversation

@alban
Copy link
Member

@alban alban commented Dec 7, 2015

Since Linux v4.4-rc1, __DEVEL__sane_behavior does not exist anymore and
is replaced by a new fstype "cgroup2".

torvalds/linux@67e9c74


Question: should systemd support unified hierarchy both before and after
Linux v4.4-rc1? If so, systemd needs to support both
__DEVEL__sane_behavior and cgroup2.

By the way, systemd-cgls is broken with the unified hierarchy.

Since Linux v4.4-rc1, __DEVEL__sane_behavior does not exist anymore and
is replaced by a new fstype "cgroup2".

torvalds/linux@67e9c74
alban added 3 commits December 7, 2015 23:18
When the systemd-nspawn is in a cgroup that is not reachable from the
current cgroup namespace, we cannot mount the cgroup for the container
in any meaningful way.

systemd or systemd-nspawn does not lead to this situation. However, the
user could use "unshare --cgroup" and then migrate the process outside
of its cgroup namespace's root, then run systemd-nspawn.
Disabled by default. Users can opt-in by setting the environment
variable CGROUP_NAMESPACE=1.
@alban
Copy link
Member Author

alban commented Dec 8, 2015

More commits added in this branch implementing cgroup namespaces (CLONE_NEWCGROUP).

@poettering
Copy link
Member

I figure we should drop the old __DEVEL__sane_behaviour as soon as 4.4 is out, and probably merge this patch only then too.

@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks postponed and removed needs-discussion 🤔 labels Dec 9, 2015
@poettering
Copy link
Member

I added the "postponed" label, to indicate that this should wait until 4.4 is released.

@poettering
Copy link
Member

Hmm I don't see how cgroupns could even work in the legacy hierarchy, as the top-level dir in cgroupfs was always special in the legacy hierarchy, and hat a couple of settings the others didn't have, such as notifier support.

Anyway, happy to see cgroups2 and cgroupsns supported, but if both of these only apply to the unified hiearchy anyway, then i'd prefer if we'd just make use of them unconditionally, after all the stuff is in flux anyway, and the fewer options the better.

@zonque
Copy link
Member

zonque commented Jan 15, 2016

Replaced by #2332

@zonque zonque closed this Jan 15, 2016
@poettering
Copy link
Member

@zonque I think you closed the wrong bug here...

@poettering poettering reopened this Jan 15, 2016
@zonque
Copy link
Member

zonque commented Jan 15, 2016

Oh, sorry. Indeed.

@poettering
Copy link
Member

I guess #2271 replaces this one.

@poettering poettering closed this Jan 26, 2016
@alban
Copy link
Member Author

alban commented Apr 6, 2016

For the record, the status of this branch:

commit 4a8d16c
nspawn: implement cgroup namespaces

Not merged. TODO.

commit a35b159
nspawn: userns and cgroup2: chown cgroup.events

Replaced by ab2c386

commit 69395c2
nspawn: refuse to start a container out of it cgroup namespace root

Not merged. TODO.

commit d8c6e5f
cgroup2: use new fstype for unified hierarchy

Merged as 0996199

@keszybz
Copy link
Member

keszybz commented Apr 6, 2016

commit 4a8d16c
nspawn: implement cgroup namespaces

Can we make this the default when we switch to unified hierarchy?

@alban
Copy link
Member Author

alban commented Apr 6, 2016

Can we make this the default when we switch to unified hierarchy?

Yes we could. We should however make sure the kernel supports cgroupns by checking /proc/self/ns/cgroup, and just not use cgroupns if not supported. The commit above does not do this.

@brauner brauner mentioned this pull request Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cgroups postponed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks

Development

Successfully merging this pull request may close these issues.

5 participants