Systemd/src/nspawn
Lennart Poettering 27adcc9737 cgroup: be more careful with which controllers we can enable/disable on a cgroup
This changes cg_enable_everywhere() to return which controllers are
enabled for the specified cgroup. This information is then used to
correctly track the enablement mask currently in effect for a unit.
Moreover, when we try to turn off a controller, and this works, then
this is indicates that the parent unit might succesfully turn it off
now, too as our unit might have kept it busy.

So far, when realizing cgroups, i.e. when syncing up the kernel
representation of relevant cgroups with our own idea we would strictly
work from the root to the leaves. This is generally a good approach, as
when controllers are enabled this has to happen in root-to-leaves order.
However, when controllers are disabled this has to happen in the
opposite order: in leaves-to-root order (this is because controllers can
only be enabled in a child if it is already enabled in the parent, and
if it shall be disabled in the parent then it has to be disabled in the
child first, otherwise it is considered busy when it is attempted to
remove it in the parent).

To make things complicated when invalidating a unit's cgroup membershup
systemd can actually turn off some controllers previously turned on at
the very same time as it turns on other controllers previously turned
off. In such a case we have to work up leaves-to-root *and*
root-to-leaves right after each other. With this patch this is
implemented: we still generally operate root-to-leaves, but as soon as
we noticed we successfully turned off a controller previously turned on
for a cgroup we'll re-enqueue the cgroup realization for all parents of
a unit, thus implementing leaves-to-root where necessary.
2018-11-23 13:41:37 +01:00
..
meson.build Drop my copyright headers 2018-06-14 13:03:20 +02:00
nspawn-cgroup.c cgroup: be more careful with which controllers we can enable/disable on a cgroup 2018-11-23 13:41:37 +01:00
nspawn-cgroup.h nspawn: Move cgroup mount stuff from nspawn-mount.c to nspawn-cgroup.c 2018-07-20 12:12:02 -04:00
nspawn-def.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-expose-ports.c sd-netlink: make sd_netlink_slot take its description 2018-10-16 18:42:23 +09:00
nspawn-expose-ports.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-gperf.gperf add ephemeral to nspawn-settings. 2018-10-24 10:22:20 +02:00
nspawn-mount.c coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
nspawn-mount.h nspawn: optionally don't mount a tmpfs over /tmp (#10294) 2018-10-08 18:32:03 +02:00
nspawn-network.c sd-device: make sd_device_get_is_initialized() returns is_initialized by return value 2018-10-29 17:33:33 +09:00
nspawn-network.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-patch-uid.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-patch-uid.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-register.c nspawn: rework how we allocate/kill scopes 2018-11-09 17:08:59 +01:00
nspawn-register.h nspawn: rework how we allocate/kill scopes 2018-11-09 17:08:59 +01:00
nspawn-seccomp.c seccomp: tighten checking of seccomp filter creation 2018-09-24 17:21:09 +02:00
nspawn-seccomp.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-settings.c nspawn: do not include '%m' in log message if errno is zero 2018-10-20 02:01:15 +09:00
nspawn-settings.h add ephemeral to nspawn-settings. 2018-10-24 10:22:20 +02:00
nspawn-setuid.c coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
nspawn-setuid.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn-stub-pid1.c nspawn: use EXIT_EXCEPTION where appropriate 2018-11-20 17:04:07 +01:00
nspawn-stub-pid1.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
nspawn.c coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
test-nspawn-tables.c test-nspawn-tables: add another "tables" test 2018-05-28 10:40:00 +02:00
test-patch-uid.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00