[CRIU] [PATCH 2/2] cgroups: Introduce cgroup management modes

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 2 09:56:32 PDT 2015


On Tue, Jun 02, 2015 at 07:24:15PM +0300, Pavel Emelyanov wrote:
> 
> OK, so we have 3 options for 2 objects. 3 for cgroups -- must be there
> (like 0 flags for open); may be there. create otherwise (O_CREAT for open);
> should not be there, create new (O_CREAT|O_EXCL). 3 for props -- always 
> restore, maybe restore (if created), don't restore. I.e. -- 9 behaviors.
> 
> cgroup     props
> 0          always
> 0          maybe      -- this is "dont", directory is expected to be there
> 0          dont
> 
> O_CREAT    always     -- this is what we need for openvz
> O_CREAT    maybe      -- this is current behavior
> O_CREAT    dont       -- this is stupid :) default props for created cgroup is not nice
> 
> O_EXCL     always
> O_EXCL     maybe      -- this is "always" -- directory is created or restore fails
> O_EXCL     dont       -- this is stupid just as O_CREAT + dont
> 
> So after cleaning this list out left things are
> 
> 0          always     -- need cgroups and overwrite props
bindroot,props, that's what we need for openvz, not the below

> 0          dont       -- need cgroups with good props
no such mode, bindroot stands for '0' here but properties
still be restored if not exist

> O_CREAT    always     -- this is what we need for openvz
no such mode, lazy for O_CREATE but props are stil be
handled depending on "props" option

> O_CREAT    maybe      -- this is current behavior
lazy

> O_EXCL     always     -- strict fresh new restore
lazy,props

> 
> What are the combinations of lazy, bindroot and props for those? And -- can we
> have some more meaningful names for it? And -- do we need separate options for
> mkdir/props for root and non-root cgroups?

By root you mean controllers, or toplevel cgroups?

Maybe use some manage-cgroup=controller:[open|creat|excl],props:[try|always]?
where open|creat|excl stand for your 0|O_CREAT|O_EXCL and try|always for
restore if not exist otherwise skip, and overwrite explicitly.


More information about the CRIU mailing list