[CRIU] [PATCH] lazy-pages: actually return to epoll_wait after completing forks

Mike Rapoport rppt at linux.vnet.ibm.com
Mon Apr 30 18:17:53 MSK 2018


Commit 9cb20327aa4 ("return to epoll_wait after completing forks") was only
half way there. Adding the other half.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index 7f6a59c..0b26c7d 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -1066,6 +1066,11 @@ out:
 	return -1;
 }
 
+/*
+ * We may exit epoll_run_rfds() loop because of non-fork() event. In
+ * such case we return 1 rather than 0 to let the caller know that no
+ * fork() events were pending
+ */
 static int complete_forks(int epollfd, struct epoll_event **events, int *nr_fds)
 {
 	struct lazy_pages_info *lpi, *n;
@@ -1206,7 +1211,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
 			ret = complete_forks(epollfd, &events, &nr_fds);
 			if (ret < 0)
 				goto out;
-			if (!restore_finished)
+			if (!restore_finished || !ret)
 				continue;
 		}
 
-- 
2.7.4



More information about the CRIU mailing list