[CRIU] [PATCH 1/3] page-pipe: allow to handle pipes in batch mode

Pavel Emelyanov xemul at parallels.com
Wed Jan 29 05:13:23 PST 2014


On 01/27/2014 06:22 PM, Andrey Vagin wrote:
> The problem is that vmsplice() to a big pipe fails very often.
> 
> The kernel allocates the linear chunk of memory for pipe buffer
> descriptos, but big allocation in kernel can fail.
> 
> So we need to restrict maximal capacity of pipes. But the number of
> pipes is restricted too, so we need to dump memory in a batch mode.

Batch mode means "several at once". Do you mean "... using one pipe"?

> TODO: send all pipes to parasite in one request
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  include/page-pipe.h |  14 ++++++++
>  page-pipe.c         | 100 +++++++++++++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 110 insertions(+), 4 deletions(-)
> 
> diff --git a/include/page-pipe.h b/include/page-pipe.h
> index 393627b..78c66b2 100644
> --- a/include/page-pipe.h
> +++ b/include/page-pipe.h
> @@ -78,6 +78,9 @@ struct page_pipe_buf {
>  	struct list_head l;	/* links into page_pipe->bufs */
>  };
>  
> +struct page_pipe;
> +typedef int (page_pipe_batch_cb)(struct page_pipe *pp, void *args);
> +
>  struct page_pipe {
>  	unsigned int nr_pipes;	/* how many page_pipe_bufs in there */
>  	struct list_head bufs;	/* list of bufs */
> @@ -89,6 +92,12 @@ struct page_pipe {
>  	unsigned int nr_holes;	/* number of holes allocated */
>  	unsigned int free_hole;	/* number of holes in use */
>  	struct iovec *holes;	/* holes */
> +
> +	unsigned int pipe_max_size; /* max allowable pipe capacity */

This thing is effectively constant. Make it such, please.

> +	int pipe_nr;		/* number of avaliable pipes */

Available where? Each page-pipe carries nr_pipes pipe bufs. What is
the new number about?

> +
> +	page_pipe_batch_cb *batch_cb; /* callback to handle batch requests */
> +	void *batch_args;	/* arguments for the callback */
>  };
>  
>  extern struct page_pipe *create_page_pipe(unsigned int nr, struct iovec *);


More information about the CRIU mailing list