<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Abhishek,</p>
<p>I have some suggestions/ideas that may be useful.<br>
</p>
<div class="moz-cite-prefix">On 22/05/2019 01:11, Abhishek Dubey
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAODppzGfxgSK1L9J0-zHLW+mZ=ZgqwPm0YjU6MZ2bxK0bJD_GQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi Pavel,</div>
<div><br>
</div>
<div>I have gone through the cr_pre_dump_tasks() function tree
and quite comfortable with parts of it. Compel stuff seem bit
difficult to digest in one go.</div>
<div>I will query if stuck somewhere in code. I think we can
start with design discussion. <br>
</div>
<div> <br>
</div>
<div>Some queries related to new approach:</div>
<div>1) We need to replace page pipe with user-space supplied
buffer. There is list of pipes in struct page_pipe. If I got
it correct then, pipe buffer in the list has to be replaced
with user-supplied buffer and these buffer exhibit same
properties as of pipes in current implementation?</div>
<div><br>
</div>
</div>
</blockquote>
<p>There is a prototype implementation which you can use as a
starting point:</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/avagin/criu/tree/process_vm_readv">https://github.com/avagin/criu/tree/process_vm_readv</a><br>
</p>
<blockquote type="cite"
cite="mid:CAODppzGfxgSK1L9J0-zHLW+mZ=ZgqwPm0YjU6MZ2bxK0bJD_GQ@mail.gmail.com">
<div dir="ltr">
<div>2) We finalized user space buffer for process_vm_readv to
be of fixed size. How do we go deciding best size (=max size
of pipe)?<br>
</div>
</div>
</blockquote>
<p>Currently, CRIU is creating a pipe and it is continuously
increasing it's buffer size (see __ppb_resize_pipe() in
criu/page-pipe.c). In the case of pre-dump (or when
--leave-running is used) it would be more efficient to compute the
necessary memory space and allocate it prior freezing the process
tree. Thus, reducing the down time during pre-copy migration.<br>
</p>
<p>Dump is currently using chunks (see commit bb98a82) and perhaps
the same idea could be applied with memory buffer(s). This reduces
the required amount of memory during checkpoint (e.g. when we want
to dump a process tree that occupies 90% of the available memory).<br>
</p>
<blockquote type="cite"
cite="mid:CAODppzGfxgSK1L9J0-zHLW+mZ=ZgqwPm0YjU6MZ2bxK0bJD_GQ@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>3) iovs generation for shared mapping are ignored and
shared mapping is handled separately. Will new approach handle
shared memory similarly?<br>
</div>
<div><br>
</div>
<div>4) Freeze - collect vmas - Unfreeze : How we go about
handling following events -<br>
</div>
<div> a) process does something such that vma gets
modified</div>
<div> - we can't ignore such mappings</div>
<div> - we can't freeze single process again,
becomes inconsistent with other tree processes<br>
</div>
<div> b) one of the process in pstree dies<br>
</div>
<div><br>
</div>
<div>- Abhishek<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 15, 2019 at 1:15
PM Pavel Emelianov <<a href="mailto:xemul@virtuozzo.com"
moz-do-not-send="true">xemul@virtuozzo.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On
5/14/19 9:08 PM, Abhishek Dubey wrote:<br>
> Hi,<br>
> <br>
> I have tried suggested way of running zdtm test suite and
played with CRIT. I am going through cr_pre_dump_tasks()
function-tree. Please point out, if I must know any other
necessary piece of code.<br>
> <br>
> I have used process_vm_readv() to copy pages, listed by
parsing /proc/PID/maps of target process (a simple process
that does mmap) and made following observations :<br>
> 1) A memory region could be read from target process only
if read access is set.<br>
<br>
Of course, that's why there's a call to
PARASITE_CMD_MPROTECT_VMAS in parasite_dump_pages_seized.<br>
We should just skip those mappnigs for the new approach.<br>
<br>
> 2) [vvar] region turned out to be one of unreadable
region, although read permission is set. Are there more such
unreadable regions expected?<br>
<br>
There's a generate_vma_iovs call that checks if we should try
to dump the vma in question at all.<br>
If I'm not mistaken, it should skip all the "bad" vmas for
you.<br>
<br>
-- Pavel<br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
CRIU mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CRIU@openvz.org">CRIU@openvz.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a>
</pre>
</blockquote>
</body>
</html>