[CRIU] [PATCH 2/3] parasite: send PARASITE_CMD_FINI before resuming the target process

Andrey Vagin avagin at openvz.org
Wed Sep 17 01:10:15 PDT 2014


The control socket has enough buffer for one command and the target
process will not wait a new command, so we will avoid extra context
switches.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 parasite-syscall.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index f514b3c..1c1a2cb 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -863,17 +863,17 @@ static int parasite_fini_seized(struct parasite_ctl *ctl)
 		return -1;
 	}
 
+	ret = __parasite_execute_daemon(PARASITE_CMD_FINI, ctl);
+	close_safe(&ctl->tsock);
+	if (ret)
+		return -1;
+
 	ret = ptrace(PTRACE_SYSCALL, pid, NULL, NULL);
 	if (ret) {
 		pr_perror("ptrace");
 		return -1;
 	}
 
-	ret = __parasite_execute_daemon(PARASITE_CMD_FINI, ctl);
-	close_safe(&ctl->tsock);
-	if (ret)
-		return -1;
-
 	if (parasite_stop_on_syscall(1, __NR_rt_sigreturn))
 		return -1;
 
-- 
1.9.3



More information about the CRIU mailing list