<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">&lt;<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>&gt;</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>
&gt; Hi, Cyrill<br>
&gt; To provide more information about this patch.<br>
&gt;<br>
&gt; 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 &quot;1024&quot; &gt; /sys/fs/cgroup/cpusets.cpu fails), it will cause problem.<br>
&gt;<br>
&gt; In contrast, when restoring with &quot;soft&quot; mode, the e-&gt;n_properties is zero so that restore_cgroup_prop() is not called.<br>
&gt;<br>
&gt; - Hui<br>
&gt;<br>
</span><span class="">&gt; On Wed, Aug 12, 2015 at 6:00 PM, Cyrill Gorcunov &lt;<a href="mailto:gorcunov@gmail.com">gorcunov@gmail.com</a> &lt;mailto:<a href="mailto:gorcunov@gmail.com">gorcunov@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On Wed, Aug 12, 2015 at 05:37:35PM -0400, Hui Kang wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;      Could you please explain how we end up having empty dir_name here?<br>
&gt;     &gt;<br>
&gt;     &gt;    This happens when restoring a process with cgroup using<br>
&gt;     &gt;    --manage-cgroup=full.<br>
&gt;     &gt;    To reproduce this error<br>
&gt;     &gt;    1. start a process<br>
&gt;     &gt;    2. mkdir /sys/fs/cgroups/cpusets/foo<br>
&gt;     &gt;    3. echo PID &gt; /sys/fs/cgroups/cpusets/foo/tasks<br>
&gt;     &gt;    4. checkpoint the process<br>
&gt;     &gt;    5. rmdir /sys/fs/cgroups/cpusets/foo or copy the checkedpoint images to a<br>
&gt;     &gt;    different host<br>
&gt;     &gt;    5. /root/criu/criu restore --log-file ./restore.log -vvvv -j<br>
&gt;     &gt;    --manage-cgroup=full<br>
&gt;<br>
&gt;     Hmm. Thanks for info! Need to think...<br>
<br>
</span>I think I&#39;ve got the point. Cpuset&#39;s top cgroups is not writable at all. Look at<br>
the kernel&#39;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&#39;s read-only */<br>
        if (cs == &amp;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><br></div><div>The exception should also be applied to cpu (e.g, cpu/cpu.shares of the top dir) because &quot;echo&quot; any value to  cpu/cpu.shares is not allowed. So the check should be applied only to cpuset.<br><br>What do you think?<br><br></div><div>- Hui<br></div><div>   <br></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>