[CRIU] [PATCH v3 10/19] criu: lazy-pages: copy remaining IOVs in chunks

Mike Rapoport rppt at linux.vnet.ibm.com
Tue Nov 15 08:57:19 PST 2016


Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index f066057..e2c8016 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -601,22 +601,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;
 		}
 	}
 
-- 
1.9.1



More information about the CRIU mailing list