[CRIU] [PATCH] lazy-pages: fix lazy dump

Mike Rapoport rppt at linux.vnet.ibm.com
Wed Jan 11 00:37:32 PST 2017


The introduction of page-server send mode have broken the lazy dump because
instead of using existing pstree, the page server now tries to recreate the
pstree from the images.
Adding lazy_dump parameter to cr_page_server resolves this issue.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/cr-dump.c           | 2 +-
 criu/cr-service.c        | 2 +-
 criu/crtools.c           | 2 +-
 criu/include/page-xfer.h | 2 +-
 criu/page-xfer.c         | 7 +++----
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index b6a9c9b..555814b 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1576,7 +1576,7 @@ static int cr_lazy_mem_dump(void)
 	int ret = 0;
 
 	pr_info("Starting lazy pages server\n");
-	ret = cr_page_server(false, -1);
+	ret = cr_page_server(false, true, -1);
 
 	for_each_pstree_item(item) {
 		destroy_page_pipe(dmpi(item)->mem_pp);
diff --git a/criu/cr-service.c b/criu/cr-service.c
index 00a2d07..fbd1065 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -704,7 +704,7 @@ static int start_page_server_req(int sk, CriuOpts *req)
 
 		pr_debug("Starting page server\n");
 
-		pid = cr_page_server(true, start_pipe[1]);
+		pid = cr_page_server(true, false, start_pipe[1]);
 		if (pid <= 0)
 			goto out_ch;
 
diff --git a/criu/crtools.c b/criu/crtools.c
index 06b2fa7..b19d368 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -772,7 +772,7 @@ int main(int argc, char *argv[], char *envp[])
 #endif
 
 	if (!strcmp(argv[optind], "page-server"))
-		return cr_page_server(opts.daemon_mode, -1) > 0 ? 0 : 1;
+		return cr_page_server(opts.daemon_mode, false, -1) > 0 ? 0 : 1;
 
 	if (!strcmp(argv[optind], "service"))
 		return cr_service(opts.daemon_mode);
diff --git a/criu/include/page-xfer.h b/criu/include/page-xfer.h
index dfe43e5..1f59bdb 100644
--- a/criu/include/page-xfer.h
+++ b/criu/include/page-xfer.h
@@ -2,7 +2,7 @@
 #define __CR_PAGE_XFER__H__
 #include "pagemap.h"
 
-extern int cr_page_server(bool daemon_mode, int cfd);
+extern int cr_page_server(bool daemon_mode, bool lazy_dump, int cfd);
 
 /*
  * page_xfer -- transfer pages into image file.
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index 770cb97..c7ea433 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -906,18 +906,17 @@ static int page_server_init_send(void)
 	return 0;
 }
 
-int cr_page_server(bool daemon_mode, int cfd)
+int cr_page_server(bool daemon_mode, bool lazy_dump, int cfd)
 {
 	int ask = -1;
 	int sk = -1;
 	int ret;
 
-	if (!opts.lazy_pages) {
+	if (!opts.lazy_pages)
 		up_page_ids_base();
-	} else {
+	else if (!lazy_dump)
 		if (page_server_init_send())
 			return -1;
-	}
 
 	if (opts.ps_socket != -1) {
 		ret = 0;
-- 
1.9.1



More information about the CRIU mailing list