[CRIU] [PATCH master v2] shmem: don't write zero pages into an image

Andrei Vagin avagin at virtuozzo.com
Thu Dec 8 17:18:23 PST 2016


https://travis-ci.org/avagin/criu/builds/182462796

On Fri, Dec 09, 2016 at 04:14:01AM +0300, Andrei Vagin wrote:
> https://github.com/xemul/criu/issues/260
> 
> v2: don't call page_pipe_add_hole for zero pages
> Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> ---
>  criu/shmem.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/criu/shmem.c b/criu/shmem.c
> index 0eb4250..8d4869b 100644
> --- a/criu/shmem.c
> +++ b/criu/shmem.c
> @@ -711,8 +711,10 @@ static int dump_one_shmem(struct shmem_info *si)
>  again:
>  		if (xfer.parent && page_in_parent(pgstate == PST_DIRTY))
>  			ret = page_pipe_add_hole(pp, pgaddr);
> -		else
> +		else if (pgstate != PST_ZERO)
>  			ret = page_pipe_add_page(pp, pgaddr);
> +		else
> +			ret = 0;
>  
>  		if (ret == -EAGAIN) {
>  			ret = dump_pages(pp, &xfer, addr);
> -- 
> 2.7.4
> 


More information about the CRIU mailing list