- 06 Sep, 2016 40 commits
-
-
Pavel Emelyanov authored
As RPC server the swrk mode is used which, in turn, is easily used by nice lib/py/criu.py thingie from Ruslan. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
Now we have a single place that is really about calling criu as CLI tool inside this class, so pull one out as a preparation to having RPC support. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
In the criu_cli class there's the whole bunch of useful code which not CLI-specific, so drop the _cli suffix. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
When migrating process it might not have slave tty peers at all so instead of exiting early just wait for its real usage and only then fail. Reported-by:
Manuel Rodríguez Pascual <manuel.rodriguez.pascual@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
This files are used by zdtm.sh. zdtm.py uses *.desc files. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Stanislav Kinsburskiy authored
Without this patch any error in check_fs_type function is considered as a grant to process to bind-mount. This patch splits mount point fs type discovering and comparison to autofs type, thus allowing to check for discovery errors. Signed-off-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
It turned out that anon shmem can have pages with non zero content and with both PME_PRESENT and PME_SWAP bits unset in all its vmas in the whole ps tree. Such case is reproduced in issue #209: 1. Dump ps tree with anon shmem filled using datagen. 2. Restore ps tree. anon shmem content is restored in open_shmem(). fd is created for it and it is unmapped from restorer process. 3. anon shmem vma is mapped in restore_mapping() of pie restorer context. anon shmem content is already initialized to non zero content but restored process doesn't touch its newly mapped vma. 4. Run CRIU dump again. All the pages of anon shmem vmas have PME_PRESENT and PME_SWAP bits unset and we don't put vma pages to dump. So if we filter anon shmem pages using PME_PRESENT and PME_SWAP bits the same way as we do it for anon private mem then we have a bug. PME_PRESENT and PME_SWAP bits work for anon private mem because at least one process would restore content of private anon vma in its own address space thus PME bits will be set and pages will be damped. We can't just stop using PME_PRESENT and PME_SWAP bits and dump all non soft dirty and non zero pfn pages. In this case each 1Gb of mapped and not used anon shmem vma will go to dump. This is too bad. To fix the bug in this patch we use mincore bits to finally understand should we dump page or not. mincore bits show page usage status better because mincore performs deeper checking of internal in-kernel state. PME bits filling is based only on process page table. Using mincore has a drawback. It doesn't work when page is in swap. But it's ok for now because mincore was used before we started using PME bits. Also mincore doesn't break page changes tracking functionality for anon shmem that we have now. This bug can be fixed in another way. For example we can make anon shmem restoration work similar to anon private mem restoration. But this fix looks much harder to implement. Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
When running criu in swrk mode the client typically wants to know the reason of failure. Right now criu reports back NOTHING but the fact that dump/restore/etc fails. We've tried to address this by introducing the cr-errno engine, but it doesn't seem to be informative enough and is hard to maintain -- adding new errno-s is boring :( I propose to report back the first message with ERROR level upon failrure as __typically__ the very first error message indicates that proceeding is impossible and criu rolls back (generating more error messages, so it's crucial to know the very first one). If we ever meet the situation that the first pr_err/pr_perror doesn't cause criu to exit, this printing should be fixed to be pr_warn. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
If we can't freeze process don't forget to return error sign, otherwise we continue operating over nonfrozen processes, leading into various errors. Signed-off-by:
Cyrill Gorcunov <gorcunov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
Running test/zdtm.py run -t zdtm/transition/maps008 --snap --pre 30 in a loop I got test failure with "Mem differs" error each ~20 minutes. The cause of the bug is in lack of synchronization between processes that still do datagen stage of test and processes that already do datacheck stage of test. As a result we can get "Mem differs" error if: 1. Process P1 being on datacheck stage fetches a byte with offset X from ashmem vma VMA1 into CPU register. 2. Process P2 still being on datagen stage changes byte with offset X in the same ashmem vma VMA1. 3. Process P1 fetches byte with offset X from another ashmem vma VMA2 mapped to the same physical memory as VMA1. 4. Process P1 compares two fetched bytes and finds out that they have different values. 5. Process P1 reports "Mem differs" error. Race is fixed by waiting for all processes to exit datagen stage before proceeding to datacheck stage. Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Here is a race when someone umounted something and this operation isn't propagated into our namespace. CRIU | Another process ----------------------------------------------------------------- pivot_root(".", put_root) | mount(put_root, MS_REC|MS_PRIVATE) | | umount /xxx/yyy | umount /xxx -> EBUSY umount(put_root) We do this to not affect mounts in put_root, but we can mask these mounts as slave and this will work for us and for external users. Reported-by: Mr Travis Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
When linkat fails in uns we print error (!) and then sometimes try some other way to linkat anyway %). Fix this place not to produce the error message all the time, but only when it's needed. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
We found that the 3.19 Ubuntu kernel has a bug and the pagemap cache doesn't work properly on this kernel. Unfortunately Travis-CI allows to create intancies only with this kernel, so we need to add this workaround. https://github.com/xemul/criu/issues/207 Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
Lets make name an unique to not shadow the global instance. On gcc-6.x series this doesn't cause problems but did on gcc-4.9 series. Nikolay Borisov <kernel@kyup.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Cyrill Gorcunov authored
The @task_entries variable is declared as external in criu/include/pstree.h and restore_finish_stage refers to it implicitly. This is a bad habbit because the name get propagated into pie code where we have a local static variable, which eventually may shadow the former copy with gcc 4.9 series as been reported by Nikolay. Lets make restore_finish_stage helper to take variable name explicitly. Reported-by:
Nikolay Borisov <kernel@kyup.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It is very hard to investigate travis fails, when something is segfaulted. Let's add our own core file handler which will provide all required information for us. Now test/abrt.sh shows a process tree, process mappings, registers and backtraces. v2: change a variable name Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Thanked-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
There is no similar jenkins script that tests similar options now. So make a new script. Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
Test does its checking both after dump and after restore. Checking is done in the following way: 1. Check that every ps tree process is stopped or dead 2a. SIGKILL every ps tree process if checking after dump 2b. SIGCONT every ps tree process if checking after restore Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It can hapen in tty tests, where we get SIGHUP. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
If a test crashes, its logs may be in testname.out.inprogress. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It works faster and checks that two criu processes can work concurrently. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Tikhomirov authored
as these sysctls can not be set to -1(default) leave them uninitialized sometimes https://jira.sw.ru/browse/PSBM-48397Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
Main test features: - Non trivial ps tree with non trivial anon shmem regions (no such test exists now). - Each ps tree process continuously writes parts of anon shmem vmas and validates these writes after restore (required for dedup testing). - Checking simultaneous changing of anon shmem contents in different processes. Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Fyodor Bocharov authored
We use the same dumping and restoring mechanism for anon private and anon shared memory. Because of this we can implement manual deduplication of shared anon memory the same way we do it with private anonymous memory. Also we need to rename pid parameter of cr_dedup_one_pagemap to id because now we can pass either pid or shmid there and the actual meaning depends on flags: PR_TASK is for pid, PR_SHMEM is for shmid. Signed-off-by:
Fyodor Bocharov <bocharovfedor@gmail.com> Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
As anon shmem dumping supports page changes tracking we can call it during predump. Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Fyodor Bocharov authored
This allows us not to dump anon shmem pages that weren't changed since last dump. We dump each anon shmem vma using page-xfer. page-xfer does all magic with storing "in_parent" field in pagemap-entry. When restoring we simply read every page with page-read and it does all magic of reading from right place in image hierarchy. auto-dedup on restore is already implemented by page-read so we don't need to code it. Signed-off-by:
Fyodor Bocharov <fbocharov@yandex.ru> Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Fyodor Bocharov authored
Anon shmem pages state tracking allows us not to dump unused anon shmem pages at all. To track anon anon shmem pages state we create a bitmap. Each 2 bits in this bitmap correspond to particular page. Each 2 bits store one page state: PST_DONT_DUMP, PST_DUMP, PST_ZERO, PST_DIRTY. This number of states is enough to decide what to do with the page on dump. With anon shmem there is a peculiarity. To decide what state page has we need to examine its PME bits in all the processes that share it. So page state derived from PME bits in one process may be overriden by page state derived from PME bits from another process. See implementation of this overrides in the patch. Signed-off-by:
Fyodor Bocharov <fbocharov@yandex.ru> Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Eugene Batalov authored
We'll use it to decide should we dump anon shmem page or not. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Fyodor Bocharov authored
So we would be able to analyze pagemap bits for each anonymous shmem page and decide on its dirtiness and usage by dumpee process. Signed-off-by:
Fyodor Bocharov <fbocharov@yandex.ru> Signed-off-by:
Eugene Batalov <eabatalov89@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
proc_parse.h is too generic and it is a bad idea to include it everywhere. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It removes a dependence between proc_parse.h and cgroup.h v2: type fix in the subject Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It remove a dependece between proc_parse.h and mount.c. v2: type fix in the subject Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
There are files that include both vma.h and proc_parse.h and since dump_filemap_t is declared in both some gccs generate a warning. Warning: proc_parse.h:131: note: previous declaration of ‘dump_filemap_t’ was here Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Nikolay Borisov authored
restorer.h eventually includes fcntl-linux.h system file, which indiscriminately defines F_SETPIPE_SZ/F_GETPIPE_SZ. But those are also defined by CRIU's own headers in config-base.h. The latter contains ifdef guards, however in arch/x86/crtools.c it's included after restorer.h which causes gcc warnings for macro redefinition. Fix this by reordering the 2 headers, ensuring the ifdef guards in config-base.h actually work. Signed-off-by:
Nikolay Borisov <kernel@kyup.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
Impact: cleanup, improve readability Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
>From the commit 64e74fab ("parasite: handle errors while a transport socket is being created"), we have futex in parasite init args to synchronize parasite and criu during initialization. And man futex(2): "On all platforms, futexes are four-byte integers that must be aligned on a four-byte boundary." This is checked by kernel in get_futex_key(): if (unlikely((address % sizeof(u32)) != 0)) return -EINVAL; So, we need to align parasite arguments on four bytes, while mapping of parasite blob on page-aligned address will guarantee that it'll be aligned on four bytes in memory. Fixes: (00.013468) ----------------------- (00.013470) Putting tsock into pid 22043 (00.014024) Error (criu/parasite-syscall.c:541): futex() returned an unexpected error: -22 (00.014026) Error (criu/parasite-syscall.c:541): BUG at criu/parasite-syscall.c:541 Cc: Andrew Vagin <avagin@virtuozzo.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-