Commit graph

2919 commits

Author SHA1 Message Date
Pavel Emelyanov
bfe77ea725 mem: Add comments
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 00:38:26 +04:00
Pavel Emelyanov
1c9a91a723 Merge branch 'br-fetch' 2013-05-15 17:51:31 +04:00
Pavel Emelyanov
39ec482c15 cr: Fix permissions on several files
cr-check.c for some reason got x bit O_o

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 17:50:57 +04:00
Cyrill Gorcunov
9251912356 x86: syscalls -- Add sys_sendto/sys_recvfrom helpers
Will be needed for parasite code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 16:49:19 +04:00
Pavel Emelyanov
12820d9bf6 stats: Don't account mem-write time into mem-dump time for regular dump
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 15:57:40 +04:00
Pavel Emelyanov
37c137092b mem/stats: Add stats about memory dumping
pages_scanned -- the amount of pages criu looked at for decision
pages_skipped_parent -- the amount of pages that were skipped, due to
                        they are present in parent image
pages_writted -- the amount of pages criu transfered into image

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 15:46:07 +04:00
Pavel Emelyanov
abd6184107 pb: Fix EOL detection in pretty parser
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 15:37:42 +04:00
Pavel Emelyanov
94722c2e35 help: Add message about "unknown command"
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:42:51 +04:00
Pavel Emelyanov
b7639611f7 help: Add \n after page-server line in synopsis
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:42:08 +04:00
Pavel Emelyanov
605f31d704 help: Move --page-server option in help text
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:41:43 +04:00
Kir Kolyshkin
ef5ef1078c criu --help: add pre-dump to synopsys
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:50 +04:00
Kir Kolyshkin
321de44986 criu --help: fix -D description
-D is used for dump and restore, i.e. to read and write image files,
depending on the command, so let's put a read/write-neutral description.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:17 +04:00
Kir Kolyshkin
f0cbd3e193 criu --help: PID is not used for restore command
A couple of fixes related to the fact.

This is an addition to commit 43ce038

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:07 +04:00
Kir Kolyshkin
2785c8bbd2 criu --help: add page-server command to synopsys
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:52:50 +04:00
Kir Kolyshkin
b13494b9fc criu --help: don't use argv[0], print help in one call
This patch

1. Replaces using argv[0] with criu literal. Using argv[0] is bad
because it can be a relative path, and it can be not "criu" but
say a symlink pointing to criu.

2. Reformats the source to print basic help test in justone call to
pr_msg(), same as commit 6ea0e00 did for extended help, for same
reasons: having it this way is easier to do further edits.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:52:40 +04:00
Cyrill Gorcunov
c459e417f3 ns: Beautify namespaces.h
I'll need to modify this header so before anything
else lets beautify it

 - drop struct pstree_item declaration it's already in pstree.h
 - move struct cr_options to top
 - align members of struct ns_desc
 - move externs to top
 - add argument name to try_show_namespaces

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:37:44 +04:00
Konstantin Khlebnikov
eaea8f252a zdtm: maps02: fix detecting VmFlags absence
#PSBM-19883

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:28:44 +04:00
Pavel Emelyanov
8e72d96881 show: Use pretty wildcard in pstree and itimers show
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
37c361178a show: Make wildcard in pb pretty
The "*:<fmt>" describes format for everyone else in pretty.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
2f223fdcf1 show: Clean fdinfo and pstree pretty fmt
Use <field>: format.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
c35c037204 pb: Enhance protobuf pretty format parsing
1. clean the code
2. add support for <field-name>:<format> strings in pretty

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
d71d17c983 help: Document memory snapshotting options
Now they seem to look OK.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:11:51 +04:00
Pavel Emelyanov
e490d7778f test: Add two tests for pre-dump action
The first is similar to existing snapshot test -- it calls
several pre-dumps on memory-changing zdtm test, then dumps
and check restore goes OK.

The second test is aimed at measuring frozen-time -- it
takes zdtm test with big mappings, dumps one, then start the
test again and calls one pre-dump plus dump. The sum of
frozen times in the 2nd dump (well, pre-dump + dump) should
be much smaller then the one of the 1st "just dump".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:03:18 +04:00
Pavel Emelyanov
a533820b7e dump: Introduce the pre-dump action
With this action criu will seize tasks, grab all its memory into
page-pipes, rest dirty tracker and will then release them. Writing
the memory from page-pipes would occur after tasks are unfreezed
and thus the frozen time should become reasonably small.

When pre-dump is in action, the dirty tracking is forcedly turned
off as well as tasks are resumed afterwards, not killed, by default.

This is a prerequisite for iterative migration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:00:40 +04:00
Pavel Emelyanov
094330c33b stats: Add writing-memory-image timing
Dumping memory is draining it from parasite, for pre-dump
this time would be reasonably small. _Writing_ the memory
would occur _after_ tasks unseize and resume.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:52:45 +04:00
Pavel Emelyanov
1b54484537 parasite: Split parasite cure routine into local and remote parts
For pre-dump we'll need to cure the target task(s), but keep the
parasite_ctl (for its local args mapping) for memory image write.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:48:51 +04:00
Pavel Emelyanov
6161208a1c test: Rename mem-snap/run.sh into run-snap.sh
There will be more tests on memory snapshot.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:46:21 +04:00
Pavel Emelyanov
b556f01be3 dump: Collect pstree IDs separately from pstree items
For pre-dump we won't need IDs, but will need items only,
thus make these two calls separate.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:44:36 +04:00
Pavel Emelyanov
d416e6a135 mem-snap: Redefine CLI options for mem snapshot
They are not documented, thus OK for now. Two options --
* one to specify where the parent images are
* one to reset dirty memory tracking

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:04:57 +04:00
Pavel Emelyanov
d9c3b91cf1 mem: Place mprotect and dump_pages args in one parasite args area
This is required for (soon to be) pre-dump command -- this command
will have to keep parasite args with pagemap (iovecs) some time after
parasite is executed. Since we call mprotect cmd _after_ pages dump
we can thus spoil these iovecs. To address this vmas to mprotect and
iovecs to dump are located in one parasite args area one after another
without intersections.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:02:18 +04:00
Pavel Emelyanov
eb41d26d4a pages: Rename parasite args->nr to args->nr_segs
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 23:05:37 +04:00
Pavel Emelyanov
c15d4ee66a dump: Cleanup dump_pages_seized arguments and declaration
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 14:09:19 +04:00
Pavel Emelyanov
d7e547dfb7 cr: Remove opts argument from cr_dump_tasks
Options are collected in global variable, no need to have them on stack.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 14:08:55 +04:00
Pavel Emelyanov
1e18128423 stats: Dump-time statistics
Basic timings for dump (freeze, frozen, mem dump).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 13:53:31 +04:00
Pavel Emelyanov
b20e7f8db9 pb: Allow for nested messages pretty specification
It's not perfect, only the depth is taken into account,
not the field number, but this is OK for now.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 13:52:18 +04:00
Pavel Emelyanov
bd1d6186be stats: Write dump stats after dump is finished
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 13:51:53 +04:00
Pavel Emelyanov
d770f4ef23 stats: Protobuf file introduction introduction
We'll have one more "image" file generated by dump and (surprisingly)
restore commands -- the stats one. It will contain in a single pb
object all the statistics collected by dump/restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 13:50:15 +04:00
Pavel Emelyanov
e75148dc03 util: Move user-per-sec constant into util.h header
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 13:50:09 +04:00
Kir Kolyshkin
3e8b82d367 Change crtools to criu in comments
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:27 +04:00
Kir Kolyshkin
c19e62f87c Change crtools to criu in criu messages
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:20 +04:00
Kir Kolyshkin
00ab805b74 cr-restore.c: fix a typo in a comment
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:08 +04:00
Kir Kolyshkin
644ed099b4 README: crtools to criu rename
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:02 +04:00
Kir Kolyshkin
0bc01e798c Documentation/Makefile: fix clean target
...after commit 1e1bf24

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:01:57 +04:00
Pavel Emelyanov
55c8f3cc7f crtools: Sanitize "action" (argv[1]) parsing
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 14:23:22 +04:00
Pavel Tikhomirov
6e5c568a5e timer: use a correct value for dumping usecs
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 13:42:59 +04:00
Kir Kolyshkin
43ce038e6e criu dump: don't require -t
and warn if it is used.

v2: fix help text as well

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 13:41:42 +04:00
Pavel Emelyanov
cd8915202e pagemap: Make show_pagemap use pb_show engine only
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:44:39 +04:00
Pavel Emelyanov
add21b75c9 show: Remove options args from ->show callback
This thing is global, we can address one explicitly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:23:42 +04:00
Pavel Emelyanov
cd537beda5 show: Get rid of flags argument from payload handler
We can "guess" one w/o addirional (obfuscating) argument to
the pb showing engine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:00:24 +04:00
Cyrill Gorcunov
1d56fe2bf4 files-reg: Use read_fd_link helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:42:59 +04:00