[CRIU] [PATCH 2/2] Attempt to restore cgroups
Pavel Emelyanov
xemul at parallels.com
Fri Jul 4 10:02:19 PDT 2014
>>> diff --git a/cgroup.c b/cgroup.c
>>> index 1fe5e6d..306bfe3 100644
>>> --- a/cgroup.c
>>> +++ b/cgroup.c
>>> @@ -18,7 +20,8 @@
>>> /*
>>> * This structure describes set of controller groups
>>> * a task lives in. The cg_ctl entries are stored in
>>> - * the @ctls list sorted by the .name field.
>>> + * the @ctls list sorted by the .name field and then
>>> + * by the .path field.
>>
>> Why do we need the .path sorting as well?
>
> I was thinking of the case when something is in both /lxc/u1 and /lxc,
> if you visit /lxc/u1 first, it goes in heads and then /lxc does as
> well. If we maintain this list as a sorted list, we will always visit
> /lxc before /lxc/u1. This is why we still have the _MATCHing below as
> well.
OK, but the matching below scans the tree with ftw, which will always
visit /lxc before /lxc/u1. Or am I missing something?
>>> @@ -861,6 +861,9 @@ static struct fstype fstypes[] = {
>>> }, {
>>> .name = "debugfs",
>>> .code = FSTYPE__DEBUGFS,
>>> + }, {
>>> + .name = "cgroup",
>>> + .code = FSTYPE__CGROUP,
>>
>> This would only handle the case when cgroup root is mounted inside container.
>> AFAIK cgroups are typically bind-mounted into container from the directory
>> where the container lives in. Maybe it makes sense to implement full cgroup
>> mount support separately?
>
> The only reason I added this was because parse_mountinfo_ent() won't
> record the fs type (it just says "unsupported") unless it is present
> in this list, and I need it to compare against to only match the
> cgroup fs. I guess another option would be to store the "raw" fstype
> in the structure as well, then we wouldn't need this hunk.
>
> I will make the other changes as well.
OK, cool :)
Thanks,
Pavel
More information about the CRIU
mailing list