[CRIU] [RFC PATCH v2 16/23] lazy-pages: add handling of UFFD_EVENT_REMAP

Pavel Emelyanov xemul at virtuozzo.com
Wed Feb 8 01:23:06 PST 2017


Applied, but one more patch is needed. Find the comment inline :)

On 02/06/2017 02:44 PM, Mike Rapoport wrote:
> When the restored process calls mremap(), we will see #PF's on the new
> addresses and we have to create a correspondence between the addresses
> found in the dump and the actual addresses the process uses. For this
> purpose we distinguish "live" address and "image" address in the lazy IOVs
> and outstanding requests. The "live" address is used to find the
> appropriate IOV and in uffd_copy and the "image" address is used to request
> pages from the page-read.
> 
> If the mremap() call causes the mapping to grow, the additional part will
> receive zero pages, as expected.
> 
> For the shrinking remaps, we will get UFFD_EVENT_UNMAP for the dropped part
> of the mapping.
> 
> Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> ---
>  criu/uffd.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 98 insertions(+), 10 deletions(-)
> 
> diff --git a/criu/uffd.c b/criu/uffd.c
> index 32a9ab5..6ac34f7 100644
> --- a/criu/uffd.c
> +++ b/criu/uffd.c
> @@ -56,6 +56,7 @@ static mutex_t *lazy_sock_mutex;
>  struct lazy_iov {
>  	struct list_head l;
>  	unsigned long base;
> +	unsigned long img_base;
>  	unsigned long len;

Please, document (with commens) fields here and ...

>  };
>  
> @@ -63,6 +64,7 @@ struct lazy_pages_info;
>  
>  struct lp_req {
>  	unsigned long addr;
> +	unsigned long img_addr;
>  	struct list_head l;

... here.

>  };
>  



More information about the CRIU mailing list