[systemd-devel] [RFC] [PATCH] cgroup: don't trim cgroup trees created by someone else

Michal Sekletar msekleta at redhat.com
Mon Nov 3 08:27:44 PST 2014


On Tue, Oct 21, 2014 at 09:16:16PM +0200, Lennart Poettering wrote:
> On Fri, 19.09.14 17:14, Michal Sekletar (msekleta at redhat.com) wrote:
> 
<snip> 
> I do see the usecase though for those projects. I'd probably suggest
> not to merge it for RHEL either. But instead I'd propose a different
> solution for software: make sure sure to always move a PID into a
> cgroup as soon as it is created, so that its removal is blocked. Or in
> other words: right before you need a cgroup to add yourself to it,
> create it, and expect that it might go away while you are not using
> it. To deal with the possible race condition of creating a cgroup
> which is immediately cleaned up by somebody else, try doing this in a
> loop, until you succeeded. 

I think I grok what are you proposing, however according to developments in 

https://bugzilla.redhat.com/show_bug.cgi?id=1139223

it doesn't seem to be correct solution either. systemd will happily remove cgroup
in which there are processes.

> 
> That way things can always stay nicely cleaned up and things are
> robust towards other processing playing around in the cgroup tree.

I am not sure how can we make that possible (playing nicely in cgroup tree) for
the time beeing until we are the only writer.

> 
> Hope that makes sense?
> 
> Lennart

Michal

> 
> -- 
> Lennart Poettering, Red Hat


More information about the systemd-devel mailing list