[CRIU] [PATCH v3 01/26] pstree: Add task_st futex

Kirill Tkhai ktkhai at virtuozzo.com
Mon Dec 5 06:07:29 PST 2016


(was "files: Wait transport_fd before sending a fd to peer")

We are going to move to the the single per-task futex
for notifications about file opening events. Introduce
pstree_item::task_st for that.

v2: Do not wait until a peer's socket is created
as it's guarantied by we create it before CR_STATE_FORKING.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/include/pstree.h |    7 +++++++
 criu/pstree.c         |    1 +
 2 files changed, 8 insertions(+)

diff --git a/criu/include/pstree.h b/criu/include/pstree.h
index 67e8516..aed52cc 100644
--- a/criu/include/pstree.h
+++ b/criu/include/pstree.h
@@ -2,6 +2,7 @@
 #define __CR_PSTREE_H__
 
 #include "common/list.h"
+#include "common/lock.h"
 #include "pid.h"
 #include "images/core.pb-c.h"
 
@@ -24,6 +25,12 @@ struct pstree_item {
 	struct pid		*threads;	/* array of threads */
 	CoreEntry		**core;
 	TaskKobjIdsEntry	*ids;
+	futex_t			task_st;
+};
+
+enum {
+	TSK_ALLOCATED = 0,
+	FDS_EVENT     = 1 << 0,
 };
 
 struct pstree_item *current;
diff --git a/criu/pstree.c b/criu/pstree.c
index 5e17f58..8eeea94 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -217,6 +217,7 @@ struct pstree_item *__alloc_pstree_item(bool rst)
 	item->pid.virt = -1;
 	item->pid.real = -1;
 	item->born_sid = -1;
+	futex_init(&item->task_st);
 
 	return item;
 }



More information about the CRIU mailing list