[CRIU] [RFC PATCH v2 09/23] lazy-pages: start handling remaining pages if IOVs list is not empty
Mike Rapoport
rppt at linux.vnet.ibm.com
Mon Feb 6 03:44:02 PST 2017
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.
Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
criu/uffd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/criu/uffd.c b/criu/uffd.c
index b9d9233..9667250 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -659,9 +659,6 @@ static int handle_remaining_pages(struct lazy_pages_info *lpi)
struct lazy_iov *iov;
int nr_pages, err;
- if (list_empty(&lpi->iovs))
- return 0;
-
iov = list_first_entry(&lpi->iovs, struct lazy_iov, l);
nr_pages = iov->len / PAGE_SIZE;
@@ -777,7 +774,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
poll_timeout = 0;
list_for_each_entry(lpi, &lpis, l) {
- if (lpi->copied_pages < lpi->total_pages) {
+ if (!list_empty(&lpi->iovs)) {
remaining = true;
ret = handle_remaining_pages(lpi);
if (ret < 0)
--
1.9.1
More information about the CRIU
mailing list