[CRIU] [PATCH v5 5/8] criu: pagemap: add entries for zero pages

Pavel Emelyanov xemul at virtuozzo.com
Thu Jul 7 03:45:48 PDT 2016


>>> @@ -342,6 +355,15 @@ static int dump_hole(struct page_xfer *xfer, struct page_pipe_iovs *iov,
>>>       return 0;
>>>  }
>>>
>>> +static int dump_holes(struct page_xfer *xfer, struct page_pipe *pp,
>>> +                   void *limit, unsigned long off)
>>> +{
>>> +     if (dump_hole(xfer, &pp->holes, limit, off, PS_IOV_HOLE))
>>> +             return -1;
>>> +
>>> +     return dump_hole(xfer, &pp->zeros, limit, off, PS_IOV_ZERO);
>>
>> This generates unsorted pagemap.img. Restore part currently assumes that it's sorted.
> 
> Why do you think so? Obviously, it was no the intention :)

Because you first write all holes below the limit, them zeroes below the
limit, but if some zeroes below the limit go before holes (below the limit),
zeroes will anyway hit the image after holes.

> The dump_hole anyway only dumps holes that are below limit, which is
> in turn the beginning of the next IOV with pages...
> 
>>> +}
>>> +
>>>  int page_xfer_dump_pages(struct page_xfer *xfer, struct page_pipe *pp,
>>>               unsigned long off)
>>>  {
>>
> 
> 
> 



More information about the CRIU mailing list