[systemd-devel] Problems with resource control delegation

Michal Sekletar msekleta at redhat.com
Thu Nov 27 02:36:41 PST 2014


Hi list,

This will be about recently added Delegate option. I think that it doesn't work
as intended. I'll describe simple scenario which exhibits the problem.

Start qemu-kvm virtual machine via libvirt. libvirt will register vm with
machined which in turn creates scope unit for vm and starts delegation of
resource control for that scope (creates cgroups in all controller hierarchies).

In my case qemu process has PID 1534, and indeed /proc/1534/cgroup indicates
that cgroups where created in all controllers as expected and process was moved
to them.

10:hugetlb:/
9:perf_event:/machine.slice/machine-qemu\x2dvm1.scope
8:blkio:/machine.slice/machine-qemu\x2dvm1.scope
7:net_cls,net_prio:/machine.slice/machine-qemu\x2dvm1.scope
6:freezer:/machine.slice/machine-qemu\x2dvm1.scope
5:devices:/machine.slice/machine-qemu\x2dvm1.scope
4:memory:/machine.slice/machine-qemu\x2dvm1.scope
3:cpu,cpuacct:/machine.slice/machine-qemu\x2dvm1.scope/emulator
2:cpuset:/machine.slice/machine-qemu\x2dvm1.scope/emulator
1:name=systemd:/machine.slice/machine-qemu\x2dvm1.scope

Next steps are reloading systemd and restarting some service.

systemctl daemon-reload
systemctl restart cups.service

Now /proc/1534/cgroup contains following,

10:hugetlb:/
9:perf_event:/machine.slice/machine-qemu\x2dvm1.scope
8:blkio:/machine.slice
7:net_cls,net_prio:/machine.slice/machine-qemu\x2dvm1.scope
6:freezer:/machine.slice/machine-qemu\x2dvm1.scope
5:devices:/machine.slice
4:memory:/machine.slice
3:cpu,cpuacct:/machine.slice
2:cpuset:/machine.slice/machine-qemu\x2dvm1.scope/emulator
1:name=systemd:/machine.slice/machine-qemu\x2dvm1.scope

In some controller hierarchies process was moved out of the scope cgroup to
machine.slice cgroup. However, scope cgroups in hierarchies still exist, for
example, /sys/fs/cgroup/memory/machine.slice/machine-qemu\\x2dvm1.scope/ is
present but doesn't contain any processes.

Is this a bug in systemd or in my understanding of how delegation should work?

Michal


More information about the systemd-devel mailing list