Commit 6490d5d3 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: introduce lazy_pages_summary

It verifies that amount of collected and transferred pages is consitent
and prints a summary
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 0b901451
...@@ -547,6 +547,20 @@ static int handle_user_fault(int fd, struct list_head *uffd_list, void *dest) ...@@ -547,6 +547,20 @@ static int handle_user_fault(int fd, struct list_head *uffd_list, void *dest)
return 0; return 0;
} }
static int lazy_pages_summary(void)
{
pr_debug("With UFFD transferred pages: (%ld/%ld)\n", uffd_copied_pages, total_pages);
if ((uffd_copied_pages != total_pages) && (total_pages > 0)) {
pr_warn("Only %ld of %ld pages transferred via UFFD\n", uffd_copied_pages,
total_pages);
pr_warn("Something probably went wrong.\n");
return 1;
}
return 0;
}
static int handle_requests(int fd) static int handle_requests(int fd)
{ {
fd_set set; fd_set set;
...@@ -606,15 +620,7 @@ static int handle_requests(int fd) ...@@ -606,15 +620,7 @@ static int handle_requests(int fd)
goto out; goto out;
} }
pr_debug("With UFFD transferred pages: (%ld/%ld)\n", uffd_copied_pages, total_pages); ret = lazy_pages_summary();
if ((uffd_copied_pages != total_pages) && (total_pages > 0)) {
pr_warn("Only %ld of %ld pages transferred via UFFD\n", uffd_copied_pages,
total_pages);
pr_warn("Something probably went wrong.\n");
ret = 1;
goto out;
}
ret = 0;
out: out:
free(dest); free(dest);
......
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