<div dir="ltr"><div>It seem to me, that clear_soft_dirty function for pte in kernel is called only</div><div>if we had explicit write to /proc/pid/clear_refs. Only after that all pages will</div><div>become write-protected and dirty tracking realy works, if new process was</div>
<div>created between snapshots, some part of its memory can be not write</div><div>protected so no PF generated for this part and some soft-dirty bits not set,</div><div>isn't it?</div><div class="gmail_extra"><br clear="all">
<div><div dir="ltr">
<br>Best Regards, Tikhomirov Pavel.</div></div>
<br><br><div class="gmail_quote">2014-04-14 16:54 GMT+04:00 Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>On 04/14/2014 04:52 PM, Pavel Tikhomirov wrote:<br>
> try next patch(3/3) without this one, you'll catch(triggers 1/5 approximately)<br>
> (00.017322) 21253: Error (page-read.c:67): No parent for snapshot pagemap<br>
> this mean that page is in parent but no parent exists<br>
<br>
</div>Plz, investigate.<br>
<div><div><br>
> sudo bash test/zdtm.sh -i 3 -s transition/fork<br>
> ================================= CRIU CHECK =================================<br>
> Looks good.<br>
> Execute zdtm/live/transition/fork<br>
> ./fork --pidfile=fork.pid --outfile=fork.out<br>
> Dump 19786<br>
> /home/snorch/temp_criu/criu/test/post-dump.sh: 3: [: post-dump: unexpected operator<br>
> Dump 19786<br>
> /home/snorch/temp_criu/criu/test/post-dump.sh: 3: [: post-dump: unexpected operator<br>
> Dump 19786<br>
> Restore<br>
> Test: zdtm/live/transition/fork, Result: FAIL<br>
> Test: zdtm/live/transition/fork, Namespace:<br>
> Dump log : /home/snorch/temp_criu/criu/test/dump/fork/19786/3/dump.log<br>
> ==================================== ERROR ====================================<br>
> --------------------------------- grep Error ---------------------------------<br>
> (00.023035) Error (image.c:202): Unable to open pagemap-21253.img: No such file or directory<br>
> (00.023046) Error (image.c:202): Unable to open pages-21253.img: No such file or directory<br>
> (00.023049) Error (page-xfer.c:661): No parent image found, though parent directory is set: No such file or directory<br>
> ------------------------------------- END -------------------------------------<br>
> Restore log: /home/snorch/temp_criu/criu/test/dump/fork/19786/3/restore.log<br>
> --------------------------------- grep Error ---------------------------------<br>
> (00.017277) 21253: Error (image.c:202): Unable to open pagemap-21253.img: No such file or directory<br>
> (00.017297) 21253: Error (image.c:202): Unable to open pages-21253.img: No such file or directory<br>
> (00.017322) 21253: Error (page-read.c:67): No parent for snapshot pagemap<br>
> (00.017468) 19786: Error (cr-restore.c:1036): 21253 exited, status=1<br>
> (00.017502) Error (cr-restore.c:1579): Restoring FAILED.<br>
> ------------------------------------- END -------------------------------------<br>
> ================================= ERROR OVER =================================<br>
><br>
><br>
> Best Regards, Tikhomirov Pavel.<br>
><br>
><br>
</div></div>> 2014-04-14 15:17 GMT+04:00 Pavel Emelyanov <<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>>>:<br>
<div>><br>
> On 04/09/2014 01:34 PM, Tikhomirov Pavel wrote:<br>
> > here was bug cause if e.g.: iterative snapshots are made and<br>
> > between two of them new process in process tree was created,<br>
> > criu will assume that all pages of this new process are "clean"<br>
> > believing that there is previous image for it and dirty tracking<br>
> > is on, but non of that is true, and it will end up in fail on restore.<br>
> ><br>
> > also this bug was not catched because of error in zdtm, look 3/3<br>
> ><br>
</div>> > Signed-off-by: Tikhomirov Pavel <<a href="mailto:snorcht@gmail.com" target="_blank">snorcht@gmail.com</a> <mailto:<a href="mailto:snorcht@gmail.com" target="_blank">snorcht@gmail.com</a>>><br>
<div><div>> > ---<br>
> > mem.c | 6 +++---<br>
> > 1 file changed, 3 insertions(+), 3 deletions(-)<br>
> ><br>
> > diff --git a/mem.c b/mem.c<br>
> > index ef1d010..6df198c 100644<br>
> > --- a/mem.c<br>
> > +++ b/mem.c<br>
> > @@ -106,7 +106,7 @@ static inline bool page_in_parent(u64 pme)<br>
> > * the memory contents is present in the pagent image set.<br>
> > */<br>
> ><br>
> > -static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u64 *off)<br>
> > +static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u64 *off, bool no_parent)<br>
> > {<br>
> > u64 *at = &map[PAGE_PFN(*off)];<br>
> > unsigned long pfn, nr_to_scan;<br>
> > @@ -130,7 +130,7 @@ static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u<br>
> > * page. The latter would be checked in page-xfer.<br>
> > */<br>
> ><br>
> > - if (page_in_parent(at[pfn])) {<br>
> > + if (page_in_parent(at[pfn]) && !no_parent) {<br>
><br>
> If xfer.parent == NULL then page_in_parent should never return true. Why is this happening?<br>
><br>
> > ret = page_pipe_add_hole(pp, vaddr);<br>
> > pages[0]++;<br>
> > } else {<br>
> > @@ -282,7 +282,7 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,<br>
> > if (!map)<br>
> > goto out_xfer;<br>
> > again:<br>
> > - ret = generate_iovs(vma_area, pp, map, &off);<br>
> > + ret = generate_iovs(vma_area, pp, map, &off, xfer.parent == NULL);<br>
> > if (ret == -EAGAIN) {<br>
> > BUG_ON(pp_ret);<br>
> ><br>
> ><br>
><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>