Blame 0096-page-xfer-stop-waiting-for-a-new-command-after-a-clo.patch

Radostin Stoyanov 46abdd7
From cc1120addd38d51f38c28fefae669172ba82120d Mon Sep 17 00:00:00 2001
Radostin Stoyanov 46abdd7
From: Andrei Vagin <avagin@gmail.com>
Radostin Stoyanov 46abdd7
Date: Wed, 22 Dec 2021 09:59:11 -0800
Radostin Stoyanov 46abdd7
Subject: [PATCH 096/120] page-xfer: stop waiting for a new command after a
Radostin Stoyanov 46abdd7
 close command
Radostin Stoyanov 46abdd7
Radostin Stoyanov 46abdd7
There is no reason to do that and in case of tls, __recv returns EAGAIN
Radostin Stoyanov 46abdd7
instead of 0.
Radostin Stoyanov 46abdd7
Radostin Stoyanov 46abdd7
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Radostin Stoyanov 46abdd7
---
Radostin Stoyanov 46abdd7
 criu/page-xfer.c | 16 +++++++++-------
Radostin Stoyanov 46abdd7
 1 file changed, 9 insertions(+), 7 deletions(-)
Radostin Stoyanov 46abdd7
Radostin Stoyanov 46abdd7
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
Radostin Stoyanov 46abdd7
index 7ff07680f..60c793009 100644
Radostin Stoyanov 46abdd7
--- a/criu/page-xfer.c
Radostin Stoyanov 46abdd7
+++ b/criu/page-xfer.c
Radostin Stoyanov 46abdd7
@@ -50,8 +50,8 @@ static void psi2iovec(struct page_server_iov *ps, struct iovec *iov)
Radostin Stoyanov 46abdd7
 #define PS_IOV_ADD_F  6
Radostin Stoyanov 46abdd7
 #define PS_IOV_GET    7
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
-#define PS_IOV_FLUSH	     0x1023
Radostin Stoyanov 46abdd7
-#define PS_IOV_FLUSH_N_CLOSE 0x1024
Radostin Stoyanov 46abdd7
+#define PS_IOV_CLOSE	   0x1023
Radostin Stoyanov 46abdd7
+#define PS_IOV_FORCE_CLOSE 0x1024
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
 #define PS_CMD_BITS 16
Radostin Stoyanov 46abdd7
 #define PS_CMD_MASK ((1 << PS_CMD_BITS) - 1)
Radostin Stoyanov 46abdd7
@@ -1223,8 +1223,8 @@ static int page_server_serve(int sk)
Radostin Stoyanov 46abdd7
 			ret = page_server_add(sk, &pi, flags);
Radostin Stoyanov 46abdd7
 			break;
Radostin Stoyanov 46abdd7
 		}
Radostin Stoyanov 46abdd7
-		case PS_IOV_FLUSH:
Radostin Stoyanov 46abdd7
-		case PS_IOV_FLUSH_N_CLOSE: {
Radostin Stoyanov 46abdd7
+		case PS_IOV_CLOSE:
Radostin Stoyanov 46abdd7
+		case PS_IOV_FORCE_CLOSE: {
Radostin Stoyanov 46abdd7
 			int32_t status = 0;
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
 			ret = 0;
Radostin Stoyanov 46abdd7
@@ -1250,7 +1250,9 @@ static int page_server_serve(int sk)
Radostin Stoyanov 46abdd7
 			break;
Radostin Stoyanov 46abdd7
 		}
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
-		if (ret || (pi.cmd == PS_IOV_FLUSH_N_CLOSE))
Radostin Stoyanov 46abdd7
+		if (ret)
Radostin Stoyanov 46abdd7
+			break;
Radostin Stoyanov 46abdd7
+		if (pi.cmd == PS_IOV_CLOSE || pi.cmd == PS_IOV_FORCE_CLOSE)
Radostin Stoyanov 46abdd7
 			break;
Radostin Stoyanov 46abdd7
 	}
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
@@ -1491,9 +1493,9 @@ int disconnect_from_page_server(void)
Radostin Stoyanov 46abdd7
 		 * the parent process) so we must order the
Radostin Stoyanov 46abdd7
 		 * page-server to terminate itself.
Radostin Stoyanov 46abdd7
 		 */
Radostin Stoyanov 46abdd7
-		pi.cmd = PS_IOV_FLUSH_N_CLOSE;
Radostin Stoyanov 46abdd7
+		pi.cmd = PS_IOV_FORCE_CLOSE;
Radostin Stoyanov 46abdd7
 	else
Radostin Stoyanov 46abdd7
-		pi.cmd = PS_IOV_FLUSH;
Radostin Stoyanov 46abdd7
+		pi.cmd = PS_IOV_CLOSE;
Radostin Stoyanov 46abdd7
 
Radostin Stoyanov 46abdd7
 	if (send_psi(page_server_sk, &pi))
Radostin Stoyanov 46abdd7
 		goto out;
Radostin Stoyanov 46abdd7
-- 
Radostin Stoyanov 46abdd7
2.34.1
Radostin Stoyanov 46abdd7