[CRIU] [PATCH] mem: Use long for memory size

Andrey Vagin avagin at virtuozzo.com
Mon Mar 13 11:49:06 PDT 2017


Applied

On Fri, Mar 10, 2017 at 01:58:02PM +0300, Cyrill Gorcunov wrote:
> When checkpointing applications with really big
> memory slab (like in our vz7 test with 920G of
> memory) the int type get cutted, we should use
> long int instead, just like we do in other code
> pieces.
> 
> Otherwise get (on vz7's criu, which s sharing the code)
> 
>  | pie: 756: Daemon waits for command
>  | (01.193097) Wait for ack 12 on daemon socket
>  | (01.193112) Fetched ack: 12 12 0
>  | (01.193164) 988065 fdinfo 0: pos:                0 flags:           100002/0
>  | (01.193201) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 0
>  | (01.193279) 988065 fdinfo 1: pos:                0 flags:           100002/0
>  | (01.193307) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 1
>  | (01.193341) 988065 fdinfo 2: pos:                0 flags:           100002/0
>  | (01.193365) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 2
>  | (01.193375) ----------------------------------------
>  | (01.193405) Error (criu/parasite-syscall.c:243): BUG at criu/parasite-syscall.c:243
>  | pie: 756: Error (criu/pie/parasite.c:676): Trimmed message received (1>
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  criu/include/mem.h | 2 +-
>  criu/mem.c         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/include/mem.h b/criu/include/mem.h
> index 8dd9ba881fed..220a30155532 100644
> --- a/criu/include/mem.h
> +++ b/criu/include/mem.h
> @@ -19,7 +19,7 @@ extern bool page_is_zero(u64 pme);
>  extern bool page_in_parent(bool dirty);
>  extern int prepare_mm_pid(struct pstree_item *i);
>  extern int do_task_reset_dirty_track(int pid);
> -extern unsigned int dump_pages_args_size(struct vm_area_list *vmas);
> +extern unsigned long dump_pages_args_size(struct vm_area_list *vmas);
>  extern int parasite_dump_pages_seized(struct pstree_item *item,
>  				      struct vm_area_list *vma_area_list,
>  				      struct mem_dump_ctl *mdc,
> diff --git a/criu/mem.c b/criu/mem.c
> index 6ef57b256383..4de0e151b56d 100644
> --- a/criu/mem.c
> +++ b/criu/mem.c
> @@ -74,7 +74,7 @@ int do_task_reset_dirty_track(int pid)
>         return ret;
>  }
>  
> -unsigned int dump_pages_args_size(struct vm_area_list *vmas)
> +unsigned long dump_pages_args_size(struct vm_area_list *vmas)
>  {
>  	/* In the worst case I need one iovec for each page */
>  	return sizeof(struct parasite_dump_pages_args) +
> -- 
> 2.7.4
> 


More information about the CRIU mailing list