[CRIU] [PATCH 19/19] parasite: Introduce parasite daemon mode

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 26 08:09:01 EST 2013


Parasite daemon mode represents a code blob which lives in
dumpee space but listen to a channel from crtools driver.

The synchronization is done by futexes, which live in tid_state_s
structure and shared between crtools and every daemon thread

	+---------+
	|   cmd   |	command for daemon to pass
	+---------+
	|   ack   |	ack when daemon finished handling
	+---------+
	|   ret   |	return code for errors
	+---------+
	    ...
	+---------+
	|  stack  |	per-thread daemon stack
	+---------+

Thus a typical scenario of "talking" to parasite daemon looks like

	crtools				daemon
	-------				------
	set-and-wake on @cmd
					wake up on @cmd
	wait for "idle" on @cmd
					handle command
					set @ret
					wake crtools on @cmd with "idle"
					wait for @ack
	wake up on @cmd by "idle"
	set @ack and wake daemon on @ack
					wake on @ack
					sleep until next @cmd

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++------
 pie/parasite.c     | 137 +++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 226 insertions(+), 51 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0019-parasite-Introduce-parasite-daemon-mode.patch
Type: text/x-patch
Size: 13172 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130226/c5b04d98/attachment-0001.bin>


More information about the CRIU mailing list