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

Andrew Vagin avagin at parallels.com
Wed Jan 29 12:12:55 PST 2014


On Wed, Jan 29, 2014 at 05:13:23PM +0400, Pavel Emelyanov wrote:
> 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"?

I mean match mode "several at once" ;).

> 
> > 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.

Ok

> 
> > +	int pipe_nr;		/* number of avaliable pipes */
> 
> Available where? Each page-pipe carries nr_pipes pipe bufs. What is
> the new number about?

Available for one batch

> 
> > +
> > +	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