2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00
Commit Graph

3248 Commits

Author SHA1 Message Date
Pavel Emelyanov
e03ab6b409 rst: Rework remaps collection on generic collect routine
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-21 00:55:26 +04:00
Pavel Emelyanov
0543f49c3e pb: Free image object of collection doesn't need it
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-21 00:55:24 +04:00
Andrey Vagin
ef3ca3a104 restore: do not kill processes if not-all of them have been created
If processes are restored without pidns, criu knows pidtheir -s from images,
but part of those task may have not yet forked, and thus the pids can not
exist or (!) be used by other processes.

To address that we abort stages RESTORE_NS and FORKING without killing tasks,
but with task_entries->start futex by writing STATE_FAIL into it and making
the tasks to check that. Since during RESTORE_NS and FORKING stages tasks can
only block on the mentioned futes, we can safely do it.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 15:17:30 +04:00
Andrey Vagin
0c5b606b48 zdtm: add a new test, where both sides of a tcp connection is dumped
Reported-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:58:14 +04:00
Andrey Vagin
4329287717 zdtm: clean up test_fork
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:57:13 +04:00
Yicheng Qin
156b1b8195 test: create env.sh for environment setting
Currently, env.sh only contains the location of criu executable.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:52:34 +04:00
Yicheng Qin
f1684be8a4 test/tcp/run.sh: fix permission
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:51:52 +04:00
Cyrill Gorcunov
71f7f7546c atomic: Use atomic_read instead of atomic_get
To switch to kernel's style.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 19:37:06 +04:00
Cyrill Gorcunov
56cb0f8baf arm: atomic -- Add atomic_read/atomic_set helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 19:37:05 +04:00
Cyrill Gorcunov
aea8a605f3 atomic -- Switch to linux kernel templates
Use same code as provided in kernel. In first place
we used own prototypes in case of simplicity (they
all were based on "lock xadd" instruction. There is
no more need for that and we can switch to well known
kernel's api.

Because kernel uses plain int type to carry atomic
counters I had to add explicit u32 type for futexes,
as well as a couple of fixes for new api usage.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 19:37:03 +04:00
Cyrill Gorcunov
19391c85b3 arm: atomic -- Use signed types for atomic_add_return/atomic_sub_return
Just like kernel does.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 19:37:02 +04:00
Cyrill Gorcunov
862e0fb2d3 x86: asm -- Add cmpxchg helpers
Will need it for atomic data conversion.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 19:37:01 +04:00
Cyrill Gorcunov
6d97dba747 sockets: inet -- Fix typo in message
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 18:57:21 +04:00
Andrey Vagin
f824d8c3e9 restore: remove restore_one_fake, which duplicates the code
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 18:55:26 +04:00
Pavel Emelyanov
33c70a244e zdtm: Simplify TEST_LIST formation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:17:13 +04:00
Pavel Emelyanov
a9e10c6056 zdtm: Remove explicit namespaces specification on restore
Yet again -- namespaces are auto-detected now, no need in this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:15:59 +04:00
Pavel Emelyanov
aa7e079d8c zdtm: Remove per-namespace list
We have automatic namespaces detection, no need in this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:14:15 +04:00
Pavel Emelyanov
01f113ecd3 rst: Remove threads restore serialization
This thing was introduced by 01f8f8f4 to help not mixing
per-thread error messages in log files. Now messages are
not mixed by other means, so this thing is useless.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-12 09:17:02 +04:00
Pavel Emelyanov
0a6da43db9 rst: Check core near the place read it from image
Doing it several steps further is less clean.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-12 09:04:56 +04:00
Pavel Emelyanov
e0b8f91493 rst: Make clean error path for root task restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-12 06:33:21 +04:00
Pavel Emelyanov
44a85ee08d rst: Switch-and-wait creds restore stage with existing helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-12 06:23:11 +04:00
Pavel Emelyanov
e5534e8e3a rstore: Invert switch_restore_stage logic
Currentl it waits for previous stage to complete and starts the
next one. Now it starts the next one and waits for it to complete.
The latter way fits better into both -- the code and the head.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-12 06:17:04 +04:00
Pavel Emelyanov
9b45833b81 stats: Account total time to restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 21:25:42 +04:00
Pavel Emelyanov
2df39a4b47 stats: Account for time to fork tasks on restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 21:22:40 +04:00
Pavel Emelyanov
c65f068489 stats: Add timing stats for restore
This will only work if timiings are reported by a single
task. Collecting them from several tasks is to be done.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 21:15:58 +04:00
Pavel Emelyanov
ebd826c97b rst: Reuse vma_list.priv_size for premapped area size calculation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:46:00 +04:00
Pavel Emelyanov
4c8e1c9927 rst: Close vmas image earlier
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:42:55 +04:00
Pavel Emelyanov
e93566c791 rst: Write comment about why we need two calls to restore_pgid
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:23:18 +04:00
Pavel Emelyanov
4c83c432d6 rst: Minor formatting fix
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:16:24 +04:00
Pavel Emelyanov
ede980c077 restore: Move kids (and session) restore into a helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:15:43 +04:00
Pavel Emelyanov
26aa61a344 rst: Rename read_vmas into prepare_vmas
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:10:44 +04:00
Pavel Emelyanov
8ff15e5c41 util: Make set_proc_mountpoint static
And rename it to better reflect what it does.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:02:33 +04:00
Pavel Emelyanov
e2a0258de3 util: Use open_detahc_mount helper for proc service fd creation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 20:00:28 +04:00
Pavel Emelyanov
cdce5d216d util: Make set_proc_fd report success/error only
Returning the new proc fd value is useless.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 19:51:02 +04:00
Andrey Vagin
3e6f1ae82d zdtm: exit with the zero code if everything is ok
Cc: Yicheng Qin <yichengq@google.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 14:47:20 +04:00
Yicheng Qin
05745ceed4 test/zdtm: add option -n for batch test
In batch-test mode, the script skips failed individual tests
instead of exiting. This ensures that all zdtm tests can be run
in one pass, which provides better overview of test result.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 13:43:07 +04:00
Yicheng Qin
a7a787a402 test: adjust the output for tests
Adjust the format of information printed.
Print out more necessary debug information.
Display error message in STDERR and make it more readable.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 13:43:06 +04:00
Andrey Vagin
1f9da83048 mm: do check on shared pages only if a vma is inherited (v2)
v2: restore page contents directly into memory
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 11:18:48 +04:00
Pavel Emelyanov
330c137c92 arm: Add atomic_add
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-13 20:05:43 +04:00
Pavel Emelyanov
e99576f655 rst: Collect stats about checked-vs-cowed pages
On restore we compare pages' contents with memcmp to check which
of them can remain shared. Report this info in restore stats.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:36:24 +04:00
Pavel Emelyanov
729ea690ed stats: Introduce protobuf message for restore stats
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:27:58 +04:00
Pavel Emelyanov
9bb545011c stats: Introduce counters for restore
These are atomic_add-s on shmalloc-ed stats.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:24:13 +04:00
Pavel Emelyanov
ab95e97fd5 atomic: Add atomic_add for x86
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:23:52 +04:00
Pavel Emelyanov
d77a05b6dc stats: Rename existing timing and cnt counters into dump_... ones
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:07:21 +04:00
Pavel Emelyanov
8f4c9acda5 stats: Allocate dumping stats dynamically
For restore all this memory would be unused. Plus, we'd need some
sign what stats to collect.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:05:52 +04:00
Pavel Emelyanov
6ac4870181 stats: Prepare for collecting restore stats
Restore stats are difficult -- we have to collect them from several
tasks and thus existing plain variables would not work. We'll need
shared memory with stats, so prepre for allocating one.

Other than this -- put call to write_stats() where appropriate for
restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 13:00:45 +04:00
Pavel Emelyanov
7f9302505c page-server: Convert opts.addr into char *
We'll have --address argument reused for library, so make this
abstract address, not ipv4 one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 12:01:14 +04:00
Yicheng Qin
073af12d5f test/zdtm: use TEST_PATTERN as argument
Use TEST_PATTERN instead of TEST_NAME as argument.
All previous zdtm commands can be used still.
It is useful to run certain part of tests.

Example of running in-namespace tests only:
	./test/zdtm.sh ^ns/.*

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-13 14:24:57 +04:00
Yicheng Qin
8891bb759d test/zdtm: add -g option to generate binary only
Add -g option in zdtm.sh.

Using -g option can just generate binaries of all
tests to run in zdtm. Moreover, appending test name after
-g option can just generate the binary for the test.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-13 14:24:55 +04:00
Yicheng Qin
62ca87d58b test/zdtm: clear unused variable "FILE_LOCK_TEST_LIST"
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-13 14:22:42 +04:00