Commit graph

9 commits

Author SHA1 Message Date
Andrew Vagin
6a400cd73a freezer: don't catch kernel threads
OpenVZ creates per-container kernel threads and they live in
container's cgroups. CRIU should skip these threads, it's impossiable to
get any state of them.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.org>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-22 17:20:57 +04:00
Andrey Vagin
f62fd61709 seize: fix used after free case
*** CID 139496:  Memory - illegal accesses  (USE_AFTER_FREE)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:25:33 +03:00
Andrey Vagin
8ea020388e dump: use freezer cgroup to seize processes (v4)
Without using a freezer cgroup, we need to do a few iterations to catch
all tasks, because a new tasks can be born. If new tasks appear faster
than criu collects them, criu fails. The freezer cgroup allows to
solve this problem.

We freeze the freezer group, then attaches to tasks with ptrace and thaw
the freezer cgroup. We suppose that all tasks which are going to be
dumped in a specified freezer group.

v2: fix comments from Christopher
Reviewed-by: Christopher Covington <cov@codeaurora.org>

v3: refactor task_seize

v4: fix comments from Pavel

Cc: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-10 16:47:51 +03:00
Andrew Vagin
69b093add1 seize: set cr_errno in collect_pstree
Before cr_errno was called from open_pid_proc(), but
now it isn't called if a root task doesn't exist.

Reported-by: Mr Jenkins
Fixes: b9b0730cb1 ("ptrace: split task_seize into seize_catch_task and seize_wait_task")
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-10 16:39:01 +03:00
Andrey Vagin
b9b0730cb1 ptrace: split task_seize into seize_catch_task and seize_wait_task
It's preparation to use a freezer cgroup for freezing tasks.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-07 13:47:11 +03:00
Andrey Vagin
2f172c8b24 crtools: split cr-dump.c in two files
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-06 14:31:06 +03:00
Cyrill Gorcunov
2e3c4e3692 Move everything related to ptrace into ptrace.[ch]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 21:57:59 +04:00
Cyrill Gorcunov
8a90464cc9 Drop some duplicated #include
And rearrange the rest.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 21:05:37 +04:00
Cyrill Gorcunov
a0f463c27d Move seize related functions into seize.[ch]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-13 19:18:43 +04:00