[CRIU] [PATCH 1/2] Re-create cgroups if necessary

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jun 25 08:06:52 PDT 2014


Quoting Saied Kazemi (saied at google.com):
> Glad things are clearer now and we're converging...  The only remaining
> decision is whether to use the same cgroup as before or not (/cpuset/lxc/u1
> or /cpuset/lxc/u1.1 in your example).  I would argue that since the state
> of a process after restore should be the same as before dump, it should be
> placed in /cpuset/lxc/u1.
> 
> With a CLI option we tell CRIU:
> 
> 1. Expect the cgroup to already exist, just put the process back in it.  If
> cgroup doesn't exist, fail.
> 2. Expect the cgroup not to exist, create it and put the process in it.  If
> cgroup exists, fail.

In lxc we support containers with the same names in multiple lxcpaths, so for
instance 3 separate containers called u1 could be running.  They will be
using /cpuset/lxc/u1, /cpuset/lxc/u1.1, and /cpuset/lxc/u1.2, based purely
on which is started first.  So demanding that the same cgroup be available
simply will not suffice.  Lxc will need a third option.  I would prefer it
to be "use $name.n for first available n" or "use template u1.XXX"
(like mkstemp).

Another complication, btw, will be to do with relative cgroup paths.  I can
probably abstract that behind the cgmanager abstraction when I add that,
but idea is - if I checkpointed u1 on the host, in /cpuset/lxc/u1, and now
restart it inside a nested container, then it should be restarted at
/cpuset/lxc/somecontainer/lxc/u1, perhaps even /cpuset/lxc/u1/lxc/u1.

-serge


More information about the CRIU mailing list