- 16 Sep, 2017 40 commits
-
-
Mike Rapoport authored
travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
This is the version from linux-next at the moment. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
With address space manipulations, amount of pages that the lazy-pages daemon will copy might differ from amount of pages we had in the dumps. Disable the warning and error retval for now; we can restore the accounting once uffd event handling stabilizes a bit. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The copied_pages and total_pages may be different because the process may drop parts of its address space. And the IOVs list will be empty iff we are done with the process. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Currently drop_lazy_iovs presumes that the range that should be dropped starts inside an IOV. This works fine with page faults and background pages but will fail for mapping changes. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The function essentially drops a memory range from lazy IOVecs travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
When printing a message about particular process events, always prefix it with "<pid>-<uffd>" for better log readability travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Currently we use pagemap to check if we should copy a page into process address space or zero it. The lazy_iov'ecs can be used instead. If a lazy_iov covers the faulting address, we should go ahead and read the page and copy it. If there is not lazy_iov for the faulting address, just zero it immediately. Searching lazy_iov's rather than pagemap will also simplify upcoming handling of UFFD_EVENT_REMAP. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Same meaning, less to type. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Multithreaded applications may concurrently generate page faults at the same address, which will cause creation of multiple requests for remote page, and, consequently, confuse the page server on the dump side. We can keep track on page fault requests in flight and ensure this way that we request a page from the remote side only once. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The kernel anyways does not really supports any flags for page fault message and we've used '#if 0' to skip the flags processing. However, we can just drop this chunk as we anyway will have do some more work than simply removing '#if 0' to handle UFFD_WP. travis-ci: success for lazy-pages: add non-#PF events handling (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
It works faster and allows to check exit codes. travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6) Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The introduction of page-server send mode have broken the lazy dump because instead of using existing pstree, the page server now tries to recreate the pstree from the images. Adding lazy_dump parameter to cr_page_server resolves this issue. travis-ci: success for lazy-pages: fix lazy dump Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Adrian Reber authored
To use lazy-pages from runc '--lazy-pages' functionality needs to be accessible via RPC. This enables lazy-pages via RPC. The information on which port to listen is taken from the criu_page_server_info protobuf structure. If the user has enabled lazy-pages via RPC only criu_page_server_info.port is evaluated to get the listen port. With additional patches in runc is it possible to use lazy-restore with 'runc checkpoint' and 'runc restore'. travis-ci: success for lazy-pages: enable lazy-pages via RPC Signed-off-by:
Adrian Reber <areber@redhat.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Rename handle_user_fault to handle_uffd_event and split actual page fault handling to a helper function travis-ci: success for lazy-pages: add non-#PF events handling Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
If an event handler returns a positive value, the event polling and handling loop is interrupted after all the pending events indicated by epoll_wait are processed. travis-ci: success for lazy-pages: add non-#PF events handling Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The number of pending events returned by epoll_wait is overridden by the first call to an event handler. Using an additional local variable resolves this issue. travis-ci: success for lazy-pages: add non-#PF events handling Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Currently we are waiting for lazy-pages daemon to finish as a part of .restore method, which may cause filling test process memory before the test process resumed it's execution after call to test_waitsig(). In such case, no page faults occur, but rather all the memory is copied in handle_remaining_pages method in uffd.c. Let's move wait(<lazy-pages-pid>,..) after call to test.stop(). travis-ci: success for lazy-pages: add non-#PF events handling Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Note, that since zero pages stats never been into master we can make incompatible changes to stats image. travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The pagemap entries for pages mapped to zero pfn proved to be not useful... travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
A page that explicitly mapped to zero pfn or a page that is not present should be treated in the same way, therefore the zero pagemaps are not required and will be removed by the following commits. travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
If a page was not marked "present" at the dump time it will not be covered by the pagemap and it will remain unmapped in the restored process. We should uffdio_zero such pages and let kernel mm to take over. travis-ci: success for revert zero pagemaps Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
CID 173076, issues/259 travis-ci: success for pagemap: verify the number of pages returned by receive_remote_pages_info Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
This function does weird things, so better have it at least somehow documented. travis-ci: success for lazy-pages: add comments to update_lazy_iovecs Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Instead of checking for availability of userfaultfd late during the restore process, make the detection of supported userfaultfd functionality part of kerndat. As a bonus, I've extended criu check with ability to verify presence of userfaultfd. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Use latest version from usefaultfd tree [1]. Judging by comments about the last re-spin of userfaultfd updates, the API will go in "as is", so we can pretty much rely on the current API definitions for proper detection of supported userfaultfd features. [1] https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Add pre-dump and remote-lazy-pages passes to criu-lazy-pages.sh Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Currently we poll userfaultfd for page faults and if there were no page faults during 5 seconds we stop monitoring the userfaultfd and start copying remaining pages chunk by chunk. If a page fault occurs during the copy, the faulting process will be stuck until the page it accessed would be copied to its address space. This patch limits the initial "page fault only" stage to 1 second instead of 5, and interleaves non-blocking poll of userfaultfd with copying of the remaining memory afterwards. travis-ci: success for lazy-pages: interleave #PF handling with transfers of remaining pages Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
travis-ci: success for lazy-pages: spelling: s/pagefalt/#PF Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
After commit a97d6d3f1609 (pagemap: replace seek_page with seek_pagemap method), uffd only searches the pagemap containing the faulting page, but it not for the page itself. For local restore it causes wrong data to be read from pages*img and subsequent crash of the restored process. Adding a call to pr->skip_pages fixes the problem. travis-ci: success for lazy-pages: fix searching for the page at #PF time Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Lazy migration requires both dumped and restored processes to coexist at the same time. This breaks some basic assumptions in the zdtm design. Simulation of lazy migration with the page server allows testing most of the involved code paths without major intervention into zdtm infrastructure. travis-ci: success for lazy-pages: improve testability (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
The kernel support for lazy pages (userfaultfd) lacks many important features which effectively prevents success in certain tests. Allow skipping such test with somewhat informative message travis-ci: success for lazy-pages: improve testability (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Currently, standalone page-server can only receive pages from the remote dump. Extend it with the ability to serve local memory dump to a remote lazy-pages daemon. travis-ci: success for lazy-pages: improve testability (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Instead of crashing dump/page-server when a problem detected after the page-pipe was split, print nice error messages and return error. travis-ci: success for page-xfer: page_server_get_pages: replace BUG_ONs with 'return -1' (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Mike Rapoport authored
Splitting of the trailing part of page-pipe buffer worked by coincidence for single page requests. Request longer than a single page were not handled correctly. The proper point for splitting the trailing part of the page-pipe buffer is the IOV following the IOV containing the desired page(s). travis-ci: success for page-pipe: (yet another) fix for split page-pipe buffers (rev2) Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Pavel Emelyanov authored
travis-ci: success for Some more cleanups over uffd.c (rev3) Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Acked-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-