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

Cyrill Gorcunov gorcunov at gmail.com
Mon Jan 27 07:11:22 PST 2014


On Mon, Jan 27, 2014 at 06:22:09PM +0400, Andrey Vagin wrote:
>  
> +/* The number of pipes for one batch request */
> +#define NR_PIPES_PER_BATCH 8
> +
> +#define PAGE_ALLOC_COSTLY_ORDER 3 /* from the kernel source code */
> +struct kernel_pipe_buffer {
> +        struct page *page;
> +        unsigned int offset, len;
> +        const struct pipe_buf_operations *ops;
> +        unsigned int flags;
> +        unsigned long private;
> +};
> +
> +void page_pipe_start_batching(struct page_pipe *pp,
> +				page_pipe_batch_cb *cb, void *args)
> +{
> +	pp->pipe_nr	= NR_PIPES_PER_BATCH;
> +	/*
> +	 * The kernel allocates the linear chunk of memory for pipe buffers.
> +	 * Allocation of chunks with size more than PAGE_ALLOC_COSTLY_ORDER
> +	 * fails very often, so we need to restrict the pipe capacity to not
> +	 * allocate big chunks.
> +	 */
> +	pp->pipe_max_size = 8 * PAGE_SIZE / sizeof(struct kernel_pipe_buffer);

	NR_PIPES_PER_BATCH * PAGE_SIZE ?

Also where PAGE_ALLOC_COSTLY_ORDER is used?


More information about the CRIU mailing list