Commit 1d85ec97 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: reset poll_timeout to 0 as soon as restore is finished

It is possible that notification about restore finish arrives at the same
time with a fork event. In such case we return to epoll_run_rfds without
resetting the poll_timeout and then we'll keep polling for events
indefinitely. To avoid this, we reset the poll_timeout to 0 as soon as we
know that restore is finished.
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 6cd7b66e
......@@ -1231,6 +1231,8 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
ret = complete_forks(epollfd, &events, &nr_fds);
if (ret < 0)
goto out;
if (restore_finished)
poll_timeout = 0;
if (!restore_finished || !ret)
continue;
}
......@@ -1238,7 +1240,6 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
/* make sure we return success if there is nothing to xfer */
ret = 0;
poll_timeout = 0;
list_for_each_entry_safe(lpi, n, &lpis, l) {
if (!list_empty(&lpi->iovs) && list_empty(&lpi->reqs)) {
ret = xfer_pages(lpi);
......
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