- 20 Nov, 2012 22 commits
-
-
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>
-
Andrey Vagin authored
This code is borrowed from the Linux kernel sources. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It will be used in restorer.c 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 socket can get fin and a state will be changed on CLOSE_WAIT, which is not supported yet. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We have a window between getting info about tcp connections and blocking them. #2419 v2: clean upV v3: don't update lengthes of queues for listen sockets, they don't used. v4: check that a state of a tcp connection is ESTABLISHED or CLOSE v5: * don't check state, because it can be changed only on TCP_CLOSE. In this case it will be changed again after restoring. * refresh a socket after enabling the repair mode Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 15 Nov, 2012 1 commit
-
-
Cyrill Gorcunov authored
- use pthread_sigmask instead of sigprocmask - show_sigset should take the size of dereferenced variable - zeroify sigsets before use, since libc has own definition for sigset which doesn't match one the kernel uses http://bugzilla.openvz.org/show_bug.cgi?id=2437Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 13 Nov, 2012 3 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Same as previous patch -- easier to read and possible to use tags. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This makes code more readable, saves one ptr on stack and lets us jump into restorer code using tags. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 12 Nov, 2012 14 commits
-
-
Pavel Emelyanov authored
Not to spoil screen with false warnings. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To test threads blocked signals restoration. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To unify the code for both thread leader and regular threads we move blocked signals for thread leader into threads argument area and use restore_thread_common() helper. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
And add missing new line in message. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
For debug purpose. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
I've moved dump_thread helper a bit lower in file since I've to call for find_thread_state helper. After all this groups all thread related functions in one slab. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This patch starts using parasite_init_threads_seized and parasite_fini_threads_seized helpers to save per-thread data in parasite and remove it on cure procedure. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just to be consistent with types we're using. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will need to extend the structure to keep not only tid/tid_addr but blocked signals as well, thus rename it to more generic parasite_dump_thread. The command PARASITE_CMD_DUMP_TID_ADDR renamed to PARASITE_CMD_DUMP_THREAD for the same sake. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
We will use them from crtools code to save and restore blocked signals mask of threads. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
- the init() now calls for init_thread() to save blocked signals mask in per-thread data - the fini() now calls for fini_thread() to restore the blocked signals, note: we could use thread_leader directly but i think calling for fini_thread() is more generic - dump_misc() now uses per-thread data Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
These helpers will be needed to save a blocked signals mask for dumpee threads. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The per-thread information requires own space in parasite data. In particular we will keep the blocked signals bound to thread pids. For this sake the caller need to provide the parasite how many threads will be used to calculate space. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
It will hold the blocked signals for threads. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-