[CRIU] Re: [PATCH cr] dump: save all vdso pages

Cyrill Gorcunov gorcunov at openvz.org
Mon Aug 20 05:57:05 EDT 2012


On Mon, Aug 20, 2012 at 01:55:07PM +0400, Andrey Vagin wrote:
> 
> If a vdso page was not accessed before dump, it's not present
> and now it doesn't save in a dump image.
> The vdso area is restored as VMA_ANON, it isn't an actual vdso more,
> so when a not-present vdso page is accessed, a zero page would be mapped.
> 
> For this reason we should save all vdso pages in a image.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  parasite.c   |    5 +++--
>  test/zdtm.sh |    4 +++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 

> diff --git a/parasite.c b/parasite.c
> index cb9bbe5..982c037 100644
> --- a/parasite.c
> +++ b/parasite.c
> @@ -104,12 +104,13 @@ static void sys_write_msg(const char *msg)
>  
>  static inline int should_dump_page(VmaEntry *vmae, u64 pme)
>  {
> -	return (pme & (PME_PRESENT | PME_SWAP)) &&
> +	return (vma_entry_is(vmae, VMA_AREA_VDSO)) ||
> +		((pme & (PME_PRESENT | PME_SWAP)) &&
>  		/*
>  		 * Optimisation for private mapping pages, that haven't
>  		 * yet being COW-ed
>  		 */
> -		!(vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE));
> +		!(vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE)));
>  }
>  
>  static int fd_pages = -1;
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index 71925a9..f495884 100644

Huh? Otherwise looks good to me. Thanks!

	Cyrill


More information about the CRIU mailing list