<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 13, 2015 at 11:11 AM, Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 08/13/2015 05:08 PM, Hui Kang wrote:<br>
> Hi, Cyrill<br>
> To provide more information about this patch.<br>
><br>
> From the cgroup.c, I see that if the restoring stratgy is full, it will always restore all the cgroup properties, which includes /sys/fs/cgroup/cpusets.cpu. As that file is not write-able by criu (i.e., echo "1024" > /sys/fs/cgroup/cpusets.cpu fails), it will cause problem.<br>
><br>
> In contrast, when restoring with "soft" mode, the e->n_properties is zero so that restore_cgroup_prop() is not called.<br>
><br>
> - Hui<br>
><br>
</span><span class="">> On Wed, Aug 12, 2015 at 6:00 PM, Cyrill Gorcunov <<a href="mailto:gorcunov@gmail.com">gorcunov@gmail.com</a> <mailto:<a href="mailto:gorcunov@gmail.com">gorcunov@gmail.com</a>>> wrote:<br>
><br>
> On Wed, Aug 12, 2015 at 05:37:35PM -0400, Hui Kang wrote:<br>
> ><br>
> > Could you please explain how we end up having empty dir_name here?<br>
> ><br>
> > This happens when restoring a process with cgroup using<br>
> > --manage-cgroup=full.<br>
> > To reproduce this error<br>
> > 1. start a process<br>
> > 2. mkdir /sys/fs/cgroups/cpusets/foo<br>
> > 3. echo PID > /sys/fs/cgroups/cpusets/foo/tasks<br>
> > 4. checkpoint the process<br>
> > 5. rmdir /sys/fs/cgroups/cpusets/foo or copy the checkedpoint images to a<br>
> > different host<br>
> > 5. /root/criu/criu restore --log-file ./restore.log -vvvv -j<br>
> > --manage-cgroup=full<br>
><br>
> Hmm. Thanks for info! Need to think...<br>
<br>
</span>I think I've got the point. Cpuset's top cgroups is not writable at all. Look at<br>
the kernel's update_cpumask() from kernel/cpuset.c file:<br>
<br>
static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,<br>
const char *buf)<br>
{<br>
int retval;<br>
<br>
/* top_cpuset.cpus_allowed tracks cpu_online_mask; it's read-only */<br>
if (cs == &top_cpuset)<br>
return -EACCES;<br>
<br>
<br>
See? Thus patch makes sense to me with two ... fixlets -- this exception should be<br>
applied only to the cpuset controller and to the restore_special_cpuset_props() too.<br></blockquote><div><br></div><div>Pavel,<br></div><div>Thanks for dig into the level that explains this. I will submit another patch with the two fixlets<br><br></div><div>- Hui<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
-- Pavel<br>
</font></span></blockquote></div><br></div></div>