[CRIU] [PATCH 00/19] Parasite daemon mode, v1
Andrew Vagin
avagin at parallels.com
Wed Feb 27 02:28:54 EST 2013
On Tue, Feb 26, 2013 at 05:08:42PM +0400, Cyrill Gorcunov wrote:
>
> Hi guys, I'm pleased to announce that named "parasite daemon mode"
> where we switch parasite code to a daemon which waits for commands
> from main crtools module.
I think a dumped application should be resumed, if crtools dump crashed.
I applied the next patch:
diff --git a/cr-dump.c b/cr-dump.c
index 3e8ef05..4edaf41 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -418,6 +418,7 @@ static int dump_task_mm(pid_t pid, const struct
proc_pid_stat *stat,
MmEntry mme = MM_ENTRY__INIT;
int ret = -1;
+ BUG();
mme.mm_start_code = stat->start_code;
mme.mm_end_code = stat->end_code;
mme.mm_start_data = stat->start_data;
bash -x test/zdtm.sh static/busyloop00
But busyloop00 was not resumed:
[root at localhost crtools]# cat /proc/6233/stack
[<ffffffff810ba1e5>] futex_wait_queue_me+0xc5/0x100
[<ffffffff810ba9a6>] futex_wait+0x196/0x2c0
[<ffffffff810bc8ac>] do_futex+0x11c/0xad0
[<ffffffff810bd2ed>] sys_futex+0x8d/0x190
[<ffffffff816385d9>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff
>
> All tests are passed, but I've tested it on x86-64 only and ARM
> version will require some tunning, in particular there is a patch
> named "x86: parasite -- Add call_daemon_thread and asm_trap helpers"
> thus same helpers are needed for ARM.
>
> Alexander, mind to take a look and check if this would be hard
> to implement the same for ARM platform?
>
> Please review, comments are welcome.
>
> Cyrill Gorcunov (19):
> Move BUG_ONs to include/bug.h
> lock: Include bug.h instead of big util.h
> pie: Pass CR_NOGLIBC in pie/Makefile
> parasite: Print unknown command number
> parasite-syscall: Use pr_perror on prctl call failure
> pstree: Bind CoreEntry to pstree item
> dump: Collect registers of dumpee early
> pie: parasite -- Move struct tid_state_s to include/parasite.h
> pie: parasite -- Allocate tid_state_s as shared memory
> parasite-syscall: Make a local map for tid_state_s
> parasite: Prepare struct tid_state_s for daemonization
> x86: parasite -- Add call_daemon_thread and asm_trap helpers
> dump: Dump threads right before parasite cure
> parasite-syscall: Rename __parasite_execute to __parasite_execute_trap
> parasite-syscall: Rename parasite_execute_by_pid to
> parasite_execute_trap_by_pid
> parasite-syscall: Rename parasite_execute to parasite_execute_trap
> parasite-syscall: Initialize global key for tid_state_s
> parasite: Init cmd/ack fields on thread init
> parasite: Introduce parasite daemon mode
>
> arch/arm/crtools.c | 2 +-
> arch/x86/crtools.c | 2 +-
> arch/x86/include/asm/parasite.h | 26 +++++
> cr-dump.c | 130 ++++++++++--------------
> include/bug.h | 30 ++++++
> include/lock.h | 2 +-
> include/parasite-syscall.h | 6 +-
> include/parasite.h | 37 +++++++
> include/pstree.h | 5 +-
> include/util.h | 31 +-----
> parasite-syscall.c | 217 +++++++++++++++++++++++++++++++++-------
> pie/Makefile | 2 +-
> pie/parasite.c | 169 ++++++++++++++++++++++---------
> pie/restorer.c | 1 -
> pstree.c | 85 +++++++++++++++-
> 15 files changed, 546 insertions(+), 199 deletions(-)
> create mode 100644 include/bug.h
>
> --
> 1.8.1.2
More information about the CRIU
mailing list