[CRIU] [PATCH 5/6] criu: pagemap: add PE_PRESENT flag

Pavel Emelyanov xemul at virtuozzo.com
Tue Sep 13 08:51:45 PDT 2016


On 09/13/2016 06:13 PM, Mike Rapoport wrote:
> On Tue, Sep 13, 2016 at 05:59:42PM +0300, Pavel Emelyanov wrote:
>> On 09/08/2016 10:39 AM, Mike Rapoport wrote:
>>> The PE_PRESENT flags is always set for pagemap entries that have
>>> corresponding pages in the pages*img. Pagemap entries describing a hole
>>> either with zero page or with pages in the parent snapshot will no have
>>> PE_PRESENT flag set.
>>
>> But why do we need the separate flag then? If entry.flag & (PE_ZERO | PE_LAZY)
>> is equivalent to it...
> 
> If we dump lazy pages for e.g. lazy restore from images, the pagemaps with
> lazy pages will have PE_PRESENT | PE_LAZY.

But how? I'm reading the page_xfer_dump_pages and see that flags will
be on pe only if it calls ->write_hole() and in this case no pages
go to the image file :(

> For post-copy, only PE_LAZY will be set and there won't be pages in
> pages*img.
> 
> The idea is to make pagemap contain all the information to decide whether
> uffd can/should be used during restore. Then we don't need to check each
> time against VMA if certain page may be lazy.



More information about the CRIU mailing list