- 27 Nov, 2012 4 commits
-
-
Cyrill Gorcunov authored
The tls_data is used for read-cycles only thus there is no need for mutex since this area get filled earlier than fork() issued. Same time on restore the tls filled before the program restarts. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
P_ALL is an argument for waitid, not waitpid. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
No need for error code here, we test results by special bitmap. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 26 Nov, 2012 3 commits
-
-
Andrey Vagin authored
If we have tree threads, a following situation can occur: T2: dec task_entries->nr_in_progress T3: dec task_entries->nr_in_progress T3: futex(&task_entries->nr_in_progress, WAKE_UP); T1: unmap task_entries T2: futex(&task_entries->nr_in_progress, WAKE_UP) -> EFAULT -> BUG_ON() This patch adds a futex for synchronising threads. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Since we have find_next_bit in our sources now, lets use for_each_bit helper to speedup a search procedure. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 23 Nov, 2012 5 commits
-
-
Stanislav Kinsbursky authored
cr-restore.c includes parasite-blob.h, which is now located in pie/ dir. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 22 Nov, 2012 10 commits
-
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Otherwise some PID-s may be busy. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
[xemul: s/-j/--shell-job/g] Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
In case if we're dumping the peer which another end belongs not to us but some other application the attempts to flush data may lead to endless SIGTTOU storm: | 1158 ioctl(53, TCFLSH, 0x2) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) | 1158 --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=5, ptr=0x5}} --- | 1158 --- stopped by SIGTTOU --- | 1158 ioctl(53, TCFLSH, 0x2) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) | 1158 --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=5, ptr=0x5}} --- | 1158 --- stopped by SIGTTOU --- so simply don't flush data, the initial attempt to use TCIOFLUSH was rather "hey, we don't have a way to say the kernel to freeze tty link for a while, lets try to workaround this limitation" but without proper kernel help this won't work anyway as Andrey has discovered. Reported-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
* Execute VNC server and glxgears * Dump/restore * Check, that VNC server accepts connections Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
Makefile.inc is included only into Makefile now. So let's insert it's content into Makefile itself. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
This patch simplifies pie build. Main change is replaces explicit rules by implicit which reduces Makefile size and makes it more readable. Notes: 1) intermediate build files are preserved. 2) Both blobs are linked with util-net.o. Restorer blob doesn't require it, but this allows to avoid explicit rule for it. v3: 1) Fixed parasite build. 2) Fixed blobs deps - %.bin and %.bin.o can now be build in parallel. 3) Updated restorer link: restorer is not linked with util-net.o anymore. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
This patch set moves all syscalls data to "arch/$(ARCH)" directory ("arch/x86" in this particular case). It does also some cleanup to syscalls-x86-64.sh. Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Stanislav Kinsbursky authored
Main things: 1) Variables are defined properly (":=" or ":=" instead of "+"). Otherwise, because we call nested makefiles, and such variables like CFLAGS are inheriting it's previous state. 2) SYS-OBJ renamed to SYSCALL-LIB. 3) Inlcude of Makefile.inc removed from protobuf/Makefile Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 20 Nov, 2012 18 commits
-
-
Cyrill Gorcunov authored
The controling terminal should be sestored by a session leader, thus we need to test if the SID we've found in process tree is a leader. Otherwise we might have pretty interesting situation: the user passed -j on dump, ie telling us to inherit shell jobs and on restore procedure the SID get inherited from the crtools but session leader for this sid doesn't belong to our peocess tree and thus we should not try to restore controlling terminal but inherit it as well. Reported-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
This test tests the following combinations: 1. parent and child have a cow-ed mapping 2. parent and child have just coinciding mappings the pages state in both should be in all possible combinations of a. write mapped b. read mapped c. not touched d. before fork e. after fork v2: * wait until a child are not prepared * check a FILE | PRIVATE mappings Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
A parent process can change a few pages after forking a child and all this pages should not be avaliable from the child. Each vma has a bitmap of existent pages. Parent's and child's bitmaps can be compared and all pages which are not present in a child bitmap are dropped. v2: don't check page_bitmap on NULL Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All memory content are restored before entering in restorer.c. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's required for restoring copy-on-write regions. The similar code will be removed from restorer.c. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
With this patch vma->shmid contains file id before mapping a region, then it contains of a temporary address. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All private vmas are placed in a premmapped region and they are sorted by start addresses, so they should be shifted apart. Here is one more problem with overlapped temporary and target regions, mremap could not remap such cases directly, so for such cases a vma is remapped away and then remapped on a target place. v2: fix accoding with Pavel's comments v3: add a huge comment with pictures Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Private vma-s are mapped before forking children, then they are remapped to corrected places in restorer.c. In restorer all unneeded vma-s are unmaped. VMA-s from premmapped regions should not be unmaped. v2: replace guard pages on arithmetic in restorer Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
In this case private vma-s will be inherited by children, it allows to restore copy-on-write reqions. This code compares child and parent vma lists. If it found two vma-s with the same start and end addresses, it decides that the child inherites this vmas from the parent. This code calculates a size of all private vma-s, then allocate a memory region for all vma-s and maps them one by one. If a vma is inherited it will be remaped to an allocated place. As a result all vma-s will be placed in a continious memory region and sorted by start addresses. This logic will be used for remap vma-s to correct address. v2: fix accoding with Pavel's comments ( clean up and simplify ) v3: simplify code and check that VMA-s are sorted Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
A private vma will be mapped in a temporary place and an address will be saved in vma->shmid, because nobody was used this field for private vma-s before. For easy reading vma_premmapped_addr will be used for getting the temporary address. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
A private vma's should be inherited by children for restoring copy-on-write regions. v2: free parent's vma-s in this patch. v3: split patch on two parts Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Makes further patching simpler Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Those will be inherited from parent. Before this patch this list was always empty, but it will change soon. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
read_vmas will be called for zombies Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
read_vmas will be called bedore forking children to restore copy-on-write memory. v2: don't open an image one more time Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Now this macros returns true only for anon | priv vmas. It will be expanded to file | priv in a follow patch. v2: check flags together. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-