[CRIU] [PATCH 1/7] lazy-pages: zero out pages not covered by the pagemap
Mike Rapoport
rppt at linux.vnet.ibm.com
Thu Dec 15 04:10:37 PST 2016
If a page was not marked "present" at the dump time it will not be covered
by the pagemap and it will remain unmapped in the restored process. We
should uffdio_zero such pages and let kernel mm to take over.
Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
criu/uffd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/criu/uffd.c b/criu/uffd.c
index 000de14..f78c512 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -588,10 +588,7 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
lpi->pr.reset(&lpi->pr);
ret = lpi->pr.seek_pagemap(&lpi->pr, address, false);
- if (!ret)
- return 0;
-
- if (pagemap_zero(lpi->pr.pe))
+ if (!ret || pagemap_zero(lpi->pr.pe))
return uffd_zero(lpi, address, nr);
lpi->pr.skip_pages(&lpi->pr, address - lpi->pr.pe->vaddr);
--
1.9.1
More information about the CRIU
mailing list