[CRIU] [PATCH 0/3] uffd: handle zero pages

Adrian Reber adrian at lisas.de
Thu Mar 31 04:52:17 PDT 2016


On Thu, Mar 31, 2016 at 02:39:18PM +0300, Mike Rapoport wrote:
> When I tried to C/R the simple program below (1) with lazy-pages, I've got the
> following errors:
> 
> (09.925241) Error (page-read.c:116): Missing 7f3387612000 in parent pagemap, current iov: base=7f3387829000,len=12288
> (09.925252) lazy-pages: seek_pagemap_page ret 0x0
> (09.925261) Error (uffd.c:375): lazy-pages: Error during UFFD copy
> (09.925271) Error (uffd.c:576): lazy-pages: Error during regular page copy
> 
> Some digging in the logs and adding debug printouts showed that the page at
> 0x7f3387612000 is mapped to zero page, skipped at dump time and that's why
> it cannot be found in the pages.img
> 
> The small addition to uffd maps to the zero page all the pages that are
> mapped by VMAs but not found in the pages.img
> 
> Mike Rapoport (3):
>   uffd: increment uffd_copied_pages only in one place
>   uffd: introduce uffd_handle_page
>   uffd: add handling of zero pages
> 
>  criu/uffd.c | 42 +++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 37 insertions(+), 5 deletions(-)
> 
> [1]: 
> -----------------------------------------
> #include <stdio.h>
> #include <unistd.h>
> 
> int main(void)
> {
> 	int i;
> 
> 	for (i = 0; ; i++) {
> 		printf("%d\n", i);
> 		fflush(stdout);
> 		sleep(1);
> 	}
> 	return 0;
> }
> -----------------------------------------

Very nice. Zero page handling was indeed completely missing. Thanks.

Acked-by: Adrian Reber <areber at redhat.com>

		Adrian



More information about the CRIU mailing list