[CRIU] [PATCH] Attempt to restore cgroups

Pavel Emelyanov xemul at parallels.com
Thu Jul 10 06:04:39 PDT 2014


On 07/09/2014 11:23 PM, Tycho Andersen wrote:

> Ah, yes, my mistake. Looks like it requires a fix in two places, below
> is the revised patch.

OK, great! I've applied the patch, thank you.
But there's one more issue. I believe we discussed one, but it's 
still there. To demonstrate one I added some logging into the code:

--- a/cgroup.c
+++ b/cgroup.c
@@ -487,6 +487,7 @@ static int dump_cg_dirs(struct list_head *dirs, size_t n_dirs, CgroupDirEntry **
                cgroup_dir_entry__init(cde);
 
                cde->path = cur->path;
+               pr_debug("CG: %s (%d kids)\n", cur->path, cur->n_children);
 
                cde->n_children = cur->n_children;
                if (cur->n_children > 0)
@@ -521,6 +522,7 @@ static int dump_controllers(CgroupEntry *cg)
                ce->cnames = cur->controllers;
                ce->n_cnames = cur->n_controllers;
                ce->n_dirs = cur->n_heads;
+               pr_debug("CG: cg from %s...\n", ce->cnames[0]);
                if (ce->n_dirs > 0)
                        if (dump_cg_dirs(&cur->heads, cur->n_heads, &ce->dirs) < 0) {
                                xfree(cg->controllers);


It shows what tree gets into the image files. And the cgroup01 test shows
me this:

(00.007655) cg: CG: cg from name=zdtmtst...
(00.007657) cg: CG: / (1 kids)
(00.007663) cg: CG: /subcg (1 kids)
(00.007666) cg: CG: /subcg/empty (0 kids)
(00.007668) cg: CG: subcg (1 kids)
(00.007671) cg: CG: subcg/empty (0 kids)

In other words -- the subcg and subcg/empty got into lists twice -- once as
the / children entries and once as top-level ones.

Thanks,
Pavel



More information about the CRIU mailing list