Skip to content
Permalink
Branch: criu-dev
Commits on Nov 15, 2018
  1. pagemap: fix reading pages from socket for --remote case

    rppt authored and avagin committed Apr 25, 2017
    When --remote option is specified, read_local_page tries to pread from a
    socket, and fails with "Illegal seek" error.
    Restore single pread call for regular image files case and introduce
    maybe_read_page_img_cache version of maybe_read_page method.
    
    Generally-approved-by: Rodrigo Bruno <rbruno@gsd.inesc-id.pt>
    Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Commits on Oct 30, 2018
  1. jenkins: lazy-pages: exclude maps04

    rppt authored and avagin committed Oct 2, 2018
    On loaded systems running maps04 with lazy-pages takes too much time. The
    same functionality is anyway covered by other tests so excluding  maps04
    shouldn't decrease the test coverage.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
  2. jenkins: split common part of lazy pages tests into a separate file

    rppt authored and avagin committed Oct 2, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
  3. travis: lazy-pages: exclude futex test for older kernels

    rppt authored and avagin committed Oct 2, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
  4. criu: parasite_prepare_threads: free memory on error path

    rppt authored and avagin committed Aug 23, 2018
    Fixes cov 191305
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  5. lazy-pages: don't mark current stack page as lazy

    rppt authored and avagin committed Aug 13, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
  6. criu: mem: introduce generate_vma_iovs helper function

    rppt authored and avagin committed Aug 13, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
  7. criu: dump: get stack pointers of all threads early

    rppt authored and avagin committed Aug 13, 2018
    The stack pointers will be later use by the memory dump to ensure that
    current stack pages are not treated as lazy.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
  8. criu: dump: prepare parasite control for threads at infect time

    rppt authored and avagin committed Aug 13, 2018
    Currently parasite_thread_ctl for non-leader threads is initialized after we
    stop the compel daemon. Moving this initialization earlier will allow us to
    make stack pointers of all threads available during memory dump.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
  9. criu: cleanup stale declarations of parasite_{init, fini}_threads_seized

    rppt authored and avagin committed Aug 13, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
  10. compel: add APIs to get stack pointers

    rppt authored and avagin committed Aug 13, 2018
    We need to know what are stack pointers of every thread to ensure that the
    current stack page will not be treated as lazy.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Acked-by: Alice Frosi <alice@linux.vnet.ibm.com>
    Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
  11. criu/config: reduce the number of argv traversals

    rppt authored and avagin committed May 9, 2018
    Instead of pre-parsing command line twice, one time to detect -h/--help and
    another time to find config file parameter, check for both in one pass.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  12. criu/config: allow init_config properly handle -h/--help

    rppt authored and avagin committed May 9, 2018
    When config parsing was split into a separate part the handling of
    -h/--help option during init_config was broken. Fix it.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  13. criu/config: rename variables counting options in config files

    rppt authored and avagin committed May 9, 2018
    s/first_count/global_cfg_argc
    s/second_count/user_cfg_argc
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  14. criu: fix 'criu --version'

    rppt authored and avagin committed Apr 26, 2018
    Currently kerndat_init() runs before command line parsing and running
    simple 'criu --version' command may produce something like:
    
    Warn  (criu/kerndat.c:847): Can't load /run/criu.kdat
    Error (criu/util.c:842): exited, status=3
    Error (criu/util.c:842): exited, status=3
    Write 4294967295 to /proc/self/loginuid failed: Operation not permittedWarn
    (criu/net.c:2732): Unable to get socket network namespace
    Warn  (criu/net.c:2732): Unable to get tun network namespace
    Warn  (criu/sk-unix.c:213): sk unix: Unable to open a socket file:
    Operation not permitted
    Error (criu/net.c:3023): Unable create a network namespace: Operation not
    permitted
    Warn  (criu/net.c:3069): NSID isn't reported for network links
    Version: 3.6
    GitID: v3.6-611-g0b27d0a
    
    Group early calls to kerndat_* and init_service_fd calls into a function
    and call this function after the command line parsing is finished.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  15. criu: split configuration parsing into separate file

    rppt authored and avagin committed Apr 26, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Commits on Jul 9, 2018
  1. zdtm/lib: don't close bad criu_status_in file descriptor in signal ha…

    rppt authored and xemul committed Jun 6, 2018
    …ndler
    
    The criu_status_in is not always used and it may be -1 when the signal
    handler closes it. With lazy-pages we hit a corner case which clobbers the
    errno value. This happens when we resume the process inside glibc syscall
    wrapper and get the signal before the page containing errno is copied. In
    this case, signal handler is invoked before the syscall return value is
    written to errno and the actual value of errno seen by the process becomes
    -EBADF because of close(-1) in the signal handler.
    
    Let's ensure that close() in signal handler does not fail to make Jenkins
    happier while the proper solution for the lazy-pages issue is found.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  2. check/servise: use cached kdat values for features check

    rppt authored and xemul committed Aug 16, 2017
    The kerndat_init() is now called before the jump to action handler. This
    allows us to directly use kdat without calling to the corresponding
    kerndat_*() methods.
    
    ✓ travis-ci: success for lazy-pages: update checks for availability of userfaultfd (rev3)
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  3. lazy-pages: uffd_{copy, zeropage}: rework error handling

    rppt authored and xemul committed Jun 6, 2018
    Improve code readability and take into account that even if
    uffdio_{copy,zeropage} has failed, some pages had been updated.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Commits on May 17, 2018
  1. lazy-pages: replace crappy num_children with simple reference counting

    rppt authored and avagin committed May 15, 2018
    The purpose of the num_children field in 'struct lazy_pages_info' was to
    prevent closing the page-read while there are still active processes that
    share it. It did work for the case when handling of the child processes
    finished before the parent process. However, if the parent lpi is closed
    first, we've got a dangling pointer at lpi->parent.
    The obvious solution is to use simple reference counting.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  2. lazy-pages: reset poll_timeout to 0 as soon as restore is finished

    rppt authored and avagin committed May 15, 2018
    It is possible that notification about restore finish arrives at the same
    time with a fork event. In such case we return to epoll_run_rfds without
    resetting the poll_timeout and then we'll keep polling for events
    indefinitely. To avoid this, we reset the poll_timeout to 0 as soon as we
    know that restore is finished.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  3. lazy-pages: handle_exit: set uffd to negative value instead of 0

    rppt authored and avagin committed May 15, 2018
    The only use for the userfault file descriptor after the process exited is
    for debug logs. Using negative value instead of 0 makes logs more readable.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  4. lazy-pages: use xfree() instead of free()

    rppt authored and avagin committed May 15, 2018
    Although they are the same, xfree() looks more consistent with other code
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Commits on May 12, 2018
  1. lazy-pages: make uffd_io_complete more robust

    rppt authored and avagin committed May 9, 2018
    Make sure we handle various corner cases:
    * we received less pages than requested
    * the request was capped because of unmap/remap etc
    * the process has exited underneath us
    
    Currently we are freeing the request once we've found the address to use
    with uffd_copy(). Instead, let's keep the request object around, use it to
    properly calculate number of pages we pass to uffd_copy() and then re-add
    tailing range (if any) to the IOVs list.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  2. lazy-pages: factor out insertion to sorted IOV list

    rppt authored and avagin committed May 9, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  3. lazy-pages: fork: fix duplication of IOV lists

    rppt authored and avagin committed May 7, 2018
    Instead of merging unfinished requests with child's IOVs we queued them
    into parent's IOV list. Fix it.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  4. lazy-pages: actually return to epoll_wait after completing forks

    rppt authored and avagin committed Apr 30, 2018
    Commit 9cb2032 ("return to epoll_wait after completing forks") was only
    half way there. Adding the other half.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  5. lazy-pages: don't try to uffd_copy to removed memory regions

    rppt authored and avagin committed Apr 16, 2018
    It is possible that when pages request from the remove source arrive, part
    of the memory range covered by the request would be already gone because of
    madvise(MADV_DONTNEED), mremap() etc.
    Ensure we are not trying to uffd_copy more than we are allowed.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  6. lazy-pages: return to epoll_wait after completing forks

    rppt authored and avagin committed Apr 16, 2018
    If we get fork() event just before transferring last IOV of the parent
    process, continuing to background fetch after completing fork event
    handling will cause lazy-pages daemon to exit and nothing will monitor the
    child process memory.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  7. lazy-pages: update events handling to take requests into account

    rppt authored and avagin committed Apr 16, 2018
    Since the memory mapping is now split between ->iovs and ->reqs lists, any
    update to memory layout should take into account both lists.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  8. lazy-pages: cache buffer size in the lazy_pages_info

    rppt authored and avagin committed Apr 16, 2018
    Instead of recalculating required for lazy_pages_info->buf when copying
    IOVs at fork() time, keep the size of the buffer in the lazy_pages_info
    struct.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  9. lazy-pages: handle_requests: fix return value propagation

    rppt authored and avagin committed Apr 16, 2018
    When we return from epoll_run_rfds with positive return value it means that
    event handling loop was interrupted because the event should be handled
    outside of that loop. Is always the case with UFFD_EVENT_FORK.
    
    It may happen that the event occurred after we've completed the memory
    transfer and we are on the way to successful return from the
    handle_requests() function, but instead of returning 0 we will return the
    positive value we've got from epoll_run_rfds.
    
    Explicitly assigning return value of complete_forks() fixes this issue.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  10. lazy-pages: merge_iov_lists: fix corner case of empty destination

    rppt authored and avagin committed Apr 16, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  11. lazy-pages: introduce merge_iov_lists helper

    rppt authored and avagin committed Apr 16, 2018
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  12. test: lazy-pages: exclude maps007

    rppt authored and avagin committed Apr 16, 2018
    With userfaultfd we cannot reliably service process_vm_readv calls. The
    maps007 test that uses these calls passed previously by sheer luck.
    
    Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Older
You can’t perform that action at this time.