Commit cdeb57a2 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: start handling remaining pages if IOVs list is not empty

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.

travis-ci: success for lazy-pages: add non-#PF events handling (rev2)
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 0110f5cf
...@@ -659,9 +659,6 @@ static int handle_remaining_pages(struct lazy_pages_info *lpi) ...@@ -659,9 +659,6 @@ static int handle_remaining_pages(struct lazy_pages_info *lpi)
struct lazy_iov *iov; struct lazy_iov *iov;
int nr_pages, err; int nr_pages, err;
if (list_empty(&lpi->iovs))
return 0;
iov = list_first_entry(&lpi->iovs, struct lazy_iov, l); iov = list_first_entry(&lpi->iovs, struct lazy_iov, l);
nr_pages = iov->len / PAGE_SIZE; nr_pages = iov->len / PAGE_SIZE;
...@@ -777,7 +774,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds) ...@@ -777,7 +774,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
poll_timeout = 0; poll_timeout = 0;
list_for_each_entry(lpi, &lpis, l) { list_for_each_entry(lpi, &lpis, l) {
if (lpi->copied_pages < lpi->total_pages) { if (!list_empty(&lpi->iovs)) {
remaining = true; remaining = true;
ret = handle_remaining_pages(lpi); ret = handle_remaining_pages(lpi);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment