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

criu: lazy-pages: copy remaining IOVs in 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>
This commit is contained in:
Mike Rapoport 2016-11-15 18:57:19 +02:00 committed by Andrei Vagin
parent 0d5d286feb
commit 20d7eb4c56

View File

@ -595,22 +595,17 @@ static int uffd_handle_pages(struct lazy_pages_info *lpi, __u64 address, int nr)
static int handle_remaining_pages(struct lazy_pages_info *lpi)
{
struct lazy_iovec *lazy_iov;
int nr_pages, i, err;
unsigned long addr;
int nr_pages, err;
lpi->pr.reset(&lpi->pr);
list_for_each_entry(lazy_iov, &lpi->iovs, l) {
nr_pages = lazy_iov->len / PAGE_SIZE;
for (i = 0; i < nr_pages; i++) {
addr = lazy_iov->base + i * PAGE_SIZE;
err = uffd_handle_pages(lpi, addr, 1);
if (err < 0) {
pr_err("Error during UFFD copy\n");
return -1;
}
err = uffd_handle_pages(lpi, lazy_iov->base, nr_pages);
if (err < 0) {
pr_err("Error during UFFD copy\n");
return -1;
}
}