Commit 7ffaf883 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: actually return to epoll_wait after completing forks

Commit 9cb20327aa4 ("return to epoll_wait after completing forks") was only
half way there. Adding the other half.
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent fb7873c9
...@@ -1066,6 +1066,11 @@ out: ...@@ -1066,6 +1066,11 @@ out:
return -1; return -1;
} }
/*
* We may exit epoll_run_rfds() loop because of non-fork() event. In
* such case we return 1 rather than 0 to let the caller know that no
* fork() events were pending
*/
static int complete_forks(int epollfd, struct epoll_event **events, int *nr_fds) static int complete_forks(int epollfd, struct epoll_event **events, int *nr_fds)
{ {
struct lazy_pages_info *lpi, *n; struct lazy_pages_info *lpi, *n;
...@@ -1206,7 +1211,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds) ...@@ -1206,7 +1211,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
ret = complete_forks(epollfd, &events, &nr_fds); ret = complete_forks(epollfd, &events, &nr_fds);
if (ret < 0) if (ret < 0)
goto out; goto out;
if (!restore_finished) if (!restore_finished || !ret)
continue; continue;
} }
......
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