[CRIU] [PATCH] Attempt to restore cgroups
Pavel Emelyanov
xemul at parallels.com
Tue Jul 8 12:09:50 PDT 2014
On 07/08/2014 09:36 PM, Tycho Andersen wrote:
> During the dump phase, /proc/cgroups is parsed to find co-mounted cgroups.
> Then, for each task /proc/self/cgroup is parsed for the cgroups that it is a
> member of, and that cgroup is traversed to find any child cgroups which may
> also need restoring. All of this information is persisted along with the
> original cg_sets, which indicate which cgroups a task is a member of.
>
> On restore, an initial phase creates all the cgroups which were saved and
> attempts to restore any peroperties they had. Then the tasks are restored into
> their respective cgroups via cg_sets as usual.
>
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
> diff --git a/include/cgroup.h b/include/cgroup.h
> index 148b26f..fc386fa 100644
> --- a/include/cgroup.h
> +++ b/include/cgroup.h
> @@ -7,5 +7,52 @@ int dump_task_cgroup(struct pstree_item *, u32 *);
> int dump_cgroups(void);
> int prepare_task_cgroup(struct pstree_item *);
> int prepare_cgroup(void);
> +/* Restore things like cpu_limit in known cgroups. */
> +int prepare_cgroup_properties(void);
> void fini_cgroup(void);
> +
> +#define HAS_MEM_LIMIT (1 << 0)
> +#define HAS_CPU_SHARES (1 << 1)
> +
Tycho, would you remove the mem limit and cpu shared so I could merge
the patch. Apparently this part will be heavily reworked, and it would
be better not to have temporary stuff in the commit.
Thanks,
Pavel
More information about the CRIU
mailing list