[CRIU] p.haul page statistics

Mike Rapoport rppt at linux.vnet.ibm.com
Wed Sep 14 05:53:49 PDT 2016


On Wed, Sep 14, 2016 at 12:05:49PM +0300, Pavel Emelyanov wrote:
> On 09/13/2016 08:18 PM, Adrian Reber wrote:
> > On Tue, Sep 13, 2016 at 06:12:28PM +0300, Pavel Emelyanov wrote:
> >> On 09/12/2016 03:08 PM, Mike Rapoport wrote:
> >>> On Mon, Sep 12, 2016 at 11:02:34AM +0200, Adrian Reber wrote:
> >>>> On Thu, Sep 08, 2016 at 08:39:06AM +0300, Mike Rapoport wrote:
> >>
> >> Erm... I saw Adrian's thoughts on counting lazy pages as written, but now I
> >> disagree with that. If we treat pages_written as "pages that went into the
> >> image file", then this definition is clean and understandable. But how to
> >> define pages_written if we count lazy pages there as well?
> >>
> >> Can we better leave pages_written as "pages that are in the images" and, if
> >> we need it, introduce pages_dumped to count all the pages that are to be
> >> taken with us regardless whether they are in the image or lazy?
> > 
> > The problem I see is with p.haul during the pre-dump. Maybe pages should
> > not be counted as lazy in the pre-dump case. There is no use to count
> > lazy pages during pre-dump.
> 
> Agreed. On pre-dump lazy pages do not make sense. But AFAIU they are not
> counted.
 
The short answer is "the lazy pages are always counted as lazy".

The longer story is that at the point when the pages are collected to pipes
and counted, the "lazy" has notion means "the page belongs to VMA that
userfaultfd can handle". Therefore, the ppb's marked as PPB_LAY may or may
not get written to the images, depending on the options.

We can add sixth parameter to generate_iovs, so that it'll be able to tell
whether it should count lazy pages or not. But, IMHO, it'll make memory
dump path even "nicer" than it is now.

In the current state, which is certainly buggy, PAGES_WRITTEN counts only
pages that cannot be handled by userfaultfd, and PAGES_LAZY counts pages
that can be handled by userfaultfd.

The patch above in this thread makes sure that PAGES_WRITTEN counts all the
pages that are in the images, while keeping PAGES_LAZY intact.

> 
> > 		Adrian
> > .

--
Sincerely yours,
Mike.



More information about the CRIU mailing list