Re: [PATCH net-next v4] xsk: support use vaddr as ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx>
Date: Thu, 16 Feb 2023 16:30:47 +0800

> When we try to start AF_XDP on some machines with long running time, due
> to the machine's memory fragmentation problem, there is no sufficient
> contiguous physical memory that will cause the start failure.
> 
> If the size of the queue is 8 * 1024, then the size of the desc[] is
> 8 * 1024 * 8 = 16 * PAGE, but we also add struct xdp_ring size, so it is
> 16page+. This is necessary to apply for a 4-order memory. If there are a
> lot of queues, it is difficult to these machine with long running time.
> 
> Here, that we actually waste 15 pages. 4-Order memory is 32 pages, but
> we only use 17 pages.
> 
> This patch replaces __get_free_pages() by vmalloc() to allocate memory
> to solve these problems.
> 
> Signed-off-by: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx>
> Acked-by: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
> ---

[...]

> diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
> index c6fb6b763658..bfb2a7e50c26 100644
> --- a/net/xdp/xsk_queue.h
> +++ b/net/xdp/xsk_queue.h
> @@ -45,6 +45,7 @@ struct xsk_queue {
>  	struct xdp_ring *ring;
>  	u64 invalid_descs;
>  	u64 queue_empty_descs;
> +	size_t ring_vmalloc_size;

The name looks a bit long to me, but that might be just personal
preference. The code itself now looks good to me.

Reviewed-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>

>  };
>  
>  /* The structure of the shared state of the rings are a simple

Next time pls make sure you added all of the reviewers to the Cc list
when sending a new revision. I noticed you posted v4 only by monitoring
the ML.

Thanks,
Olek



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux