2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

8651 Commits

Author SHA1 Message Date
Mike Rapoport
f45229886e lazy-pages: drop _page suffix from uffd_{copy,zero}_page
travis-ci: success for uffd: A new set of improvements
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:34 +03:00
Mike Rapoport
1bdd3e46eb criu: lazy_pages: make buffer for copying pages per-process
Currently we allocate a single page to use as intermediate buffer for
holding data that will be used in UFFDIO_COPY. Let's allocate a buffer per
process and make that buffer large enough to hold the largest continuos
chunk.

travis-ci: success for uffd: A new set of improvements
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:34 +03:00
Mike Rapoport
ec585622ef lazy-pages: fix zero pages handling
page_read->seek_page was restored to skip zero pagemaps, therefore we
should check its return value rather than underlying PME.

travis-ci: success for uffd: A new set of improvements
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
a98eed95fa lazy-pages: refactor uffd_handle_page
Inline relevant parts of get_page inside uffd_handle_page and call
uffd_{copy,zero}_page after we've got the data.

travis-ci: success for uffd: A new set of improvements
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
7c6f72cf4d uffd: Introduce lazy_pages_fd as preparation for socket polling
We will want to poll not only a bunch of uffd-s, but also the lazy
socket, so here's "an fd and a callback" object to be pushed into
epoll.

travis-ci: success for uffd: A new set of improvements
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
700419bc7e criu: lazy-pages: replace page list with IOVs list
Instead of tracking memory handled by userfaultfd on the page basis we can
use IOVs for continious chunks.

travis-ci: success for uffd: A new set of improvements
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
0086dca47d uffdd: Implement --daemon mode
Right now the zdtm.py hacks around core code and waits for
a second for the socket to appear. Let's better make proper
--daemon mode for lazy-pages daemon and pidfile generation.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
fe53a87f70 criu: lazy-pages: simplify intialization of lazy pages list
Instead of creating mm-related parts of restore info in process tree we
can directly use MmEntry for VMA traversals.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
c00dd3459f criu: lazy-pages: move find_vmas and related code around
Moving the find_vmas and collect_uffd_pages functions before they are
actually used. This allows to drop forward declaration of find_vmas and
will make subsequent refactoring cleaner.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
6d405370da uffd: Check for uffd event being PF early
The event received should be checked to be #PF before
accessing its other arguments.

[ Mike:
    Well, looking forward to see non-cooperative userfaultfd patches in kernel
    we should have something like

    static int handle_uffd_enent(struct lazy_pages_info *lpi)
    {
    	read(&msg...);

    	switch (msg.event) {
    	case UFFD_EVENT_PAGEFAULT:
    		handle_pagefault(lpi, msg);
    		break;
    	default:
    		return -1;
    	}
    }

    But since this patch is anyway is a bugfix: <ack>
]

travis-ci: success for uffd: A set of improvements over criu/uffd.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
51e6e19d11 uffd: Turn lpi_hash into list
After previous patch we no longer need this hash since
we don't need fd -> lpi conversion.

travis-ci: success for uffd: A set of improvements over criu/uffd.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
6f4c60c611 uffd: Keep lpi pointer on epoll_event, not fd
This helps us get lpi MUCH faster on #PF.

travis-ci: success for uffd: A set of improvements over criu/uffd.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
345b4e77ef uffdd: Read pages directly into destination buffer
This avoids excessive memcpy() one instruction below.

travis-ci: success for uffd: A set of improvements over criu/uffd.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Kir Kolyshkin
82c8229100 uffd.c: error logging nitpicks
In cases errno is being set, we need to use pr_perror() to print it.

In cases errno is not set, we should use pr_err().

pr_perror() doesn't need a colon or a newline. pr_err() needs a newline.

Cc: Adrian Reber <areber@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
travis-ci: success for Assorted nitpicks
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
145c509495 lazy-pages: use relative path for UNIX socket
Use relative path for UNIX socket instead of absolute one.
This ensures we won't run into problems with invalid socket names.

travis-ci: success for lazy-pages: use relative path for UNIX socket
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
428226a8ac lazy-pages: handle zombie processes
Restore of a zombie process does not call setup_uffd which causes
lazy-pages daemon to stuck forever waiting for (pid, uffd) pair to arrive.
Let's extend the protocol between restore and lazy-pages so that for zombie
process a (0, -1) pair will be sent instead of actual (uffd, pid).

travis-ci: success for lazy-pages: misc fixes (rev4)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
1a92e78911 lazy-pages: send_uffd: make sure mutex is unlocked on error paths
travis-ci: success for lazy-pages: misc fixes (rev4)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
ec71c1daa4 lazy-pages: make ud_open return int
To properly handle zombie processes we will need to distinguish failures
coming from socket communications from absent userfault file descriptor

travis-ci: success for lazy-pages: misc fixes (rev4)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
14dbe3a7a8 lazy-pages: do not treat VMAs that have MAP_LOCKED as lazy
When a VMA is mapped with MAP_LOCKED it is address space is populated with
pages which causes UFFDIO_COPY to return -EXISTS. Until we can find some
better solution let's avoid marking VMAs with MAP_LOCKED as lazy.

Fixes: #238

travis-ci: success for lazy-pages: misc fixes (rev3)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
a29f84a4ab jenkins: fix criu-lazy-pages.sh permissions
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Adrian Reber
7d88ee5799 Added option to display dump/restore lazy and zero pages stats
# criu dump --display-stats -D /tmp/cp -t <PID>
 Displaying dump stats:
 ...
 Zero memory pages: 0 (0x0)
 Lazy memory pages: 0 (0x0)

travis-ci: success for Added option to display dump/restore stats (rev2)
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Adrian Reber
e3fb9bd9c4 lazy-pages: add support to combine pre-copy and post-copy
Only the UFFD daemon is aware if pages are in the parent or not. The
restore will continue to work as any lazy-restore except that pages from
parent checkpoints will be pre-populated by the restorer.

The restorer will still register the whole memory region as being
handled by userfaultfd even if it contains pages from parent
checkpoints. Userfaultfd page faults will only happen on pages which
contain no data. This means from the parent pre-populated pages will not
trigger a userfaultfd message even if marked as being handled by
userfaultfd.

The UFFD daemon knows about pages which are available in the parent
checkpoints and will not push those pages unnecessarily to userfaultfd.

Following steps to migrate a process are now possible:

Source system:

 * criu pre-dump -D /tmp/cp/1 -t <PID>
 * rsync -a /tmp/cp <destination>:/tmp
 * criu dump -D /tmp/cp/2 -t <PID> --port 27 --lazy-pages \
   --prev-images-dir ../1/ --track-mem

Destination system:

 * rsync -a <source>:/tmp/cp /tmp/
 * criu lazy-pages --page-server --address <source> --port 27 \
   -D /tmp/cp/2 &
 * criu restore --lazy-pages -D /tmp/cp/2

This will now restore all pages from the parent checkpoint if they
are not marked as lazy in the second checkpoint.

v2:
 - changed parent detection to use pagemap_in_parent()

v3:
 - unfortunately this reverts
   c11cf95afbe023a2816a3afaecb65cc4fee670d7
   "criu: mem: skip lazy pages during restore based on pagemap info"
   To be able to split the VMA-s in the right chunks for the restorer
   it is necessary to make the decision lazy or not on the VmaEntry
   level.

v4:
 - everything has changed thanks to Mike Rapoport's suggestion
 - the VMA-s are no longer touched or split
 - instead of over 100 lines of changes this is now two line patch

Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Mike Rapoprot <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Adrian Reber
c1f0b1f5a2 page-pipe: correctly split page-pipe-buffers
Combining pre-copy (pre-dump) and post-copy (lazy-pages) mode showed a
problem in the function page_pipe_split_ppb(). The function is used to
split the page-pipe-buffer so that it only contains the IOVs request
from the restore side during lazy restore.

Unfortunately it only splits the leading IOVs out of the
page-pipe-buffer and not the trailing:

Before split for requested address 0x7f27284d1000:

 page-pipe: ppb->iov 0x7f0f74d93040
 page-pipe: 		0x7f27282bb000 1
 page-pipe: 		0x7f27284d1000 1
 page-pipe: 		0x7f27284dd000 2

After split:

 page-pipe: ppb->iov 0x7f0f74d93050
 page-pipe: 		0x7f27284d1000 1
 page-pipe: 		0x7f27284dd000 2

and:

 page-pipe: ppb->iov 0x7f0f74d93040
 page-pipe: 		0x7f27282bb000 1

This patch keeps on splitting the page-pipe-buffer until it contains
only the requested address with the requested length.

After split (still trying to load 0x7f27284d1000):

 page-pipe: ppb->iov 0x7f0f74d93050
 page-pipe: 		0x7f27284d1000 1

and:

 page-pipe: ppb->iov 0x7f0f74d93040
 page-pipe: 		0x7f27282bb000 1

and:

 page-pipe: ppb->iov 0x7f0f74d93060
 page-pipe: 		0x7f27284dd000 2

v2:
 - moved declarations to the declaration block

Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
976cb5f841 criu: mem: count all pages actually written to image as "pages_written"
Currently potentially lazy pages are not counted as written even if they
are dump into pages*img. Count these pages as "pages_written" when dump is
not going to skip writing lazy pages to disk.

travis-ci: success for criu: mem: count all pages actually written to image as "pages_written"
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Adrian Reber
2ce576e646 crit: translate pagemap flags into strings
This translates pagemap flags into strings for easier readability.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
8505a8ccfd pageserver: Merge page_server_add with page_server_hole
Do the same here, the flags is now enough to tell hole
from pagemap.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
4ea4653ce1 xfer: Merge write_hole and _pagemap callbacks
They are now the same and PE_PRESENT bit helps us distinguish
holes from pagemaps having pages inside.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Pavel Emelyanov
6d2b35ceef xfer: Change ->write_hole's type to flags
The ->write_hole and ->write_pagemap now look very much
alike, so let's merge them. This is preparatory patch
that makes holy type decision based on PE_FOO flags.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
d7105cce15 criu: mem: skip lazy pages during restore based on pagemap info
Instead of checking whether the VMA containing a page can be lazy for each
page, skip the entire parts of pagemap that have PE_LAZY flag set.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
96dd5298e5 criu: pagemap: add PE_PRESENT flag
The PE_PRESENT flags is always set for pagemap entries that have
corresponding pages in the pages*img. Pagemap entries describing a hole
either with zero page or with pages in the parent snapshot will no have
PE_PRESENT flag set.
Pagemap entry that may be lazily restored is a special case. For the lazy
restore from disk case, both PE_LAZY and PE_PRESENT will be set in the
pagemap, but for the remote lazy pages case only PE_LAZY will be set.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
ea99b70072 criu: page-xfer: add ability to write pagemap flags
With 'zero' and 'lazy' booleans replaced by the flags field in
PagemapEntry, it is required that page-xfer will be aware of the change.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
9bc9fcb0ce criu: pagemap: replace 'zero' and 'lazy' booleans with 'flags'
Having three booleans in pagemap entry clues for usage of good old flags.
Replace 'zero' and 'lazy' booleans with flags and use flags for internal
tracking of in_parent value. Eventually, in_parent may be deprecated.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
b711f89cf4 test: allow lazy-pages tests in namespaces
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
c95226054e criu: lazy-pages: refactor UNIX socket initialization
Create the socket early so that it will be available after restoring the
namespaces

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
4bb1272ba5 test: add scripts to allow Mr. Jenkins check lazy-pages
Very minimalistic at the moment, no remote pages and namesapces.
Still better than nothing :)

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:32 +03:00
Andrew Vagin
f59b45fba2 zdtm: check lazy-pages
Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:32 +03:00
Eugene Batalov
b929e86c83 mem: make page_is_zero externally linked
We'll use it in anon shmem dedup so we need to have access
to it in shmem.c

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:32 +03:00
Mike Rapoport
a405d25b60 criu/lazy-pages: fix socket creation with relative images-dir
The UNIX sockets do not like relative paths. Assuming both lazy-pages
daemon and restore use the same opts.work_dir, their working directory full
path will be the same.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Pavel Tikhomirov
0f60684b8f make lpi_fini handle NULL to allow it after failed lpi_init in ud_open
https://github.com/xemul/criu/issues/187
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Mike Rapoport
5ad71a8901 criu: lazy-pages: enable remoting of lazy pages
The remote lazy pages variant can be run as follows:

src# criu dump -t <pid> --lazy-pages --port 9876 -D /tmp/1 &
src# while ! sudo fuser 9876/tcp ; do sleep 1; done
src# scp -r /tmp/1/ dst:/tmp/

dst# criu lazy-pages --page-server --address dst --port 9876 -D /tmp/1 &
dst# criu restore --lazy-pages -D /tmp/1

In a nutshell, this implementation of remote lazy pages does the following:

- dump collects the process memory into the pipes, transfers non-lazy pages
  to the images or to the page-server on the restore side. The lazy pages
  are kept in pipes for later transfer
- when the dump creates the page_pipe_bufs, it marks the buffers containing
potentially lazy pages with PPB_LAZY
- at the dump_finish stage, the dump side starts TCP server that will
handle page requests from the restore side
- the checkpoint directory is transferred to the restore side
- on the restore side lazy-pages daemon is started, it creates UNIX socket
to receive uffd's from the restore and a TCP socket to forward page
requests to the dump side
- restore creates memory mappings and fills the VMAs that cannot be handled
by uffd with the contents of the pages*img.
- restore registers lazy VMAs with uffd and sends the userfault file
descriptors to the lazy-pages daemon
- when a #PF occurs, the lazy-pages daemon sends PS_IOV_GET command to the dump
side; the command contains PID, the faulting address and amount of pages
(always 1 at the moment)
- the dump side extracts the requested pages from the pipe and splices them
into the TCP socket.
- the lazy-pages daemon copies the received pages into the restored process
address space

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Mike Rapoport
9982fc9e68 criu: page-xfer: add PS_IOV_GET interface
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Mike Rapoport
a9a973da77 criu: add ability to skip writing lazy pages
When appropriate, the lazy pages will no be written to the destination.
Instead, a pagemap entry for range of such pages will be marked with 'lazy'
flag.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Mike Rapoport
a1ed9e0992 criu: pagemap: add entries for zero pages
The pages that are mapped to zero_page_pfn are not dumped but information
where are they located is required for lazy restore.
Note that get_pagemap users presumed that zero pages are not a part of the
pagemap and these pages were just silently skipped during memory restore.
At the moment I preserve this semantics and force get_pagemap to skip zero
pages.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:04 +03:00
Mike Rapoport
b2dafe74d0 criu: lazy-pages: use new pagemap features
Pagemap now is more friendly to random accesses, enable use of new APIs.

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>
2017-09-16 09:10:03 +03:00
Mike Rapoport
c12477da94 criu: lazy-pages: create UNIX socket for lazy-pages daemon in work_dir
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00
Mike Rapoport
a2c1affc18 criu: lazy-pages: don't modify variable used in a loop
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00
Mike Rapoport
6f7f11e3b3 criu: lazy-pages: take care of possible NULL pointer dereference
Fix CID 163485 (#2 of 2): Dereference null return value (NULL_RETURNS)
7. dereference: Dereferencing a pointer that might be null dest when
calling handle_user_fault.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00
Mike Rapoport
b6cad30524 criu: page-pipe: introduce page_pipe_destroy_ppb
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00
Mike Rapoport
dce7ce1e03 criu: page-pipe: introduce page_pipe_split
This will allow to split a ppb so that data residing at specified address
will be immediately available

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00
Mike Rapoport
e3fec3af05 criu: page_pipe_buf: add PPB_LAZY flag
for buffers that contain potentially lazy pages

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:10:03 +03:00