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

Mike Rapoport rppt at linux.vnet.ibm.com
Tue Sep 13 09:08:17 PDT 2016


On Tue, Sep 13, 2016 at 06:51:45PM +0300, Pavel Emelyanov wrote:
> 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 :(

The hunk at @@ -450,13 +451,18 @@ criu/page-xfer.c in this patch takes care
of that.
When page_xfer_dump_pages encounters buffer marked as lazy, it checks
whether it should dump lazy pages or not. In case it shouldn't, it creates
a hole using ->write_hole. Otherwise, it uses ->write_pagemap with
PE_PRESENT | PE_LAZY.
 
> > 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