[CRIU] [PATCH master] shmem: skip zero pages

Andrei Vagin avagin at openvz.org
Fri Dec 9 08:37:51 PST 2016


From: Andrei Vagin <avagin at virtuozzo.com>

page_in_parent() returns true for all not dirty pages,
probably it should not be executed for zero pages.

------------------------ grep Error ------------------------
(00.115327) Error (criu/pagemap.c:191): Missing 8000 in parent pagemap, current iov: base=9000,len=32768
(00.115329) Error (criu/page-xfer.c:237): Hole 0x8000/4096 not found in parent
(00.160222) Error (criu/cr-dump.c:1636): Dumping FAILED.
------------------------ ERROR OVER ------------------------

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/shmem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/criu/shmem.c b/criu/shmem.c
index 8d4869b..cc32f10 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -709,12 +709,12 @@ static int dump_one_shmem(struct shmem_info *si)
 
 		pgaddr = (unsigned long)addr + pfn * PAGE_SIZE;
 again:
-		if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
+		if (pgstate == PST_ZERO)
+			ret = 0;
+		else if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
 			ret = page_pipe_add_hole(pp, pgaddr);
-		else if (pgstate != PST_ZERO)
-			ret = page_pipe_add_page(pp, pgaddr);
 		else
-			ret = 0;
+			ret = page_pipe_add_page(pp, pgaddr);
 
 		if (ret == -EAGAIN) {
 			ret = dump_pages(pp, &xfer, addr);
-- 
2.7.4



More information about the CRIU mailing list