<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-08-04 18:08 GMT+03:00 Tycho Andersen <span dir="ltr"><<a href="mailto:tycho.andersen@canonical.com" target="_blank">tycho.andersen@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Eugene,<br>
<br>
On Thu, Aug 04, 2016 at 02:49:23PM +0300, Eugene Batalov wrote:<br>
> Hi Tycho,<br>
<span class="">><br>
> > > +int gc_network_unlock(void)<br>
> > > +{<br>
> > > + /*<br>
> > > + * Unshared ps tree net ns is destroyed after successful dump.<br>
> > > + * No need to call network_unlock_internal.<br>
> > > + * Also don't call ACT_NET_UNLOCK script because we don't<br>
> > > + * resume/restore ps tree - this call would break<br>
> > > + * ACT_NET_UNLOCK semantics.<br>
> > > + */<br>
> > > + return rst_unlock_tcp_connections();<br>
> ><br>
> > What about cpt_unlock_tcp_connections()? IIUC this list is not<br>
> > persisted, and so if we leave around the network lock stuff, we would<br>
> > never turn of TCP repair mode.<br>
> ><br>
> > Tycho<br>
> ><br>
> Let's consider the moment when we start criu gc or criu restore. At<br>
> this moment dumpee ps tree doesn't exist and ps tree sockets don't<br>
> exist.<br>
<br>
</span>Hmm. Perhaps I misunderstood then. I thought the point was to be able<br>
to use --leave-stopped (so the ps tree would still exist), and then we<br>
could at a later time run `criu gc` to unlock things again and clean<br>
this up.<br></blockquote><div>Looks like this is the use case you need to support. Let's look at current implementation. Does it satisfies your needs?</div><div>We can kill whole ps tree with any standard signal based logic so it looks like there is no problem here.</div><div>But is it possible for you to have dump of this killed ps tree. criu gc needs this dump in order to do its job.</div><div>Also criu gc requires only subset of the dump (memory is not needed).</div><div><br></div><div>For now I prefer current criu gc implementation that works with dumps rather then with live ps trees.</div><div>In general If we want to c/r we always create dump from live ps tree but we don't always restore ps tree from dump.</div><div>So dump is more basic thing that criu gc relies on. The only question is about availability of such a dump for gc.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><br>
> That's why we don't need to turn any tcp repair mode off - it is per socket<br>
> thing.<br>
> Also cpt_unlock_tcp_connections called from network_unlock() that is called<br>
> during criu restore<br>
> does nothing because cpt_tcp_repair_sockets list is empty. So for me it<br>
> looks like criu gc works<br>
> the same as criu restore but without calling of network unlock action<br>
> script.<br>
<br>
</span>I understand; it may be worth noting somewhere in the help output or<br>
patch notes what exactly the use case is. Right now I don't undersand<br>
what it is :)<br></blockquote><div> Yep. I'll add more info into criu help message in the next patch set version. Thank you for suggestion.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888"><br>
Tycho<br>
</font></span><div class=""><div class="h5"><br>
> ><br>
> > > +}<br>
> > > +<br>
> > > int veth_pair_add(char *in, char *out)<br>
> > > {<br>
> > > char *aux;<br>
> > > diff --git a/criu/sk-tcp.c b/criu/sk-tcp.c<br>
> > > index 13d175a..c4aa58f 100644<br>
> > > --- a/criu/sk-tcp.c<br>
> > > +++ b/criu/sk-tcp.c<br>
> > > @@ -713,16 +713,19 @@ void tcp_locked_conn_add(struct inet_sk_info *ii)<br>
> > > ii->sk_fd = -1;<br>
> > > }<br>
> > ><br>
> > > -void rst_unlock_tcp_connections(<wbr>void)<br>
> > > +int rst_unlock_tcp_connections(<wbr>void)<br>
> > > {<br>
> > > struct inet_sk_info *ii;<br>
> > ><br>
> > > /* Network will be unlocked by network-unlock scripts */<br>
> > > if (root_ns_mask & CLONE_NEWNET)<br>
> > > - return;<br>
> > > + return 0;<br>
> > ><br>
> > > list_for_each_entry(ii, &rst_tcp_repair_sockets, rlist)<br>
> > > - nf_unlock_connection_info(ii);<br>
> > > + if (nf_unlock_connection_info(ii)<wbr>)<br>
> > > + return -1;<br>
> > > +<br>
> > > + return 0;<br>
> > > }<br>
> > ><br>
> > > int check_tcp(void)<br>
> > > --<br>
> > > 1.9.1<br>
> > ><br>
> > > ______________________________<wbr>_________________<br>
> > > CRIU mailing list<br>
> > > <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> > > <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/<wbr>mailman/listinfo/criu</a><br>
> ><br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Eugene Batalov.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Best regards,<br>Eugene Batalov.</div>
</div></div>