[CRIU] [PATCH] Revert "page-server: Allow blocking on pipe"

Andrei Vagin avagin at openvz.org
Mon Jan 2 12:48:54 PST 2017


From: Andrei Vagin <avagin at virtuozzo.com>

This reverts commit 00e25daaf2bddf8ff998b7ef0e0ef70b988cd660.

Actually we can't block on pipe, because the page-server has
only one thread. It splices data from socket to pipe and then
reads data from this pipe. We are tring to calculete a chunk size
to not block on pipe, but this chunk size isn't accurate if
spliced data are not allign to a page size.

https://github.com/xemul/criu/issues/265
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/page-xfer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index c95a55f..fe9563f 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -592,7 +592,7 @@ static int page_server_add(int sk, struct page_server_iov *pi, u32 flags)
 		if (chunk > cxfer.pipe_size)
 			chunk = cxfer.pipe_size;
 
-		chunk = splice(sk, NULL, cxfer.p[1], NULL, chunk, SPLICE_F_MOVE);
+		chunk = splice(sk, NULL, cxfer.p[1], NULL, chunk, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
 		if (chunk < 0) {
 			pr_perror("Can't read from socket");
 			return -1;
-- 
2.7.4



More information about the CRIU mailing list