[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <779078a5-a4c8-6f75-2063-912d02e47bc7@intel.com>
Date: Thu, 16 Feb 2023 14:04:47 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
CC: <netdev@...r.kernel.org>,
Björn Töpel <bjorn@...nel.org>,
Magnus Karlsson <magnus.karlsson@...el.com>,
"Maciej Fijalkowski" <maciej.fijalkowski@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
"David S. Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
"John Fastabend" <john.fastabend@...il.com>, <bpf@...r.kernel.org>
Subject: Re: [PATCH net-next v4] xsk: support use vaddr as ring
From: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
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@...ux.alibaba.com>
> Acked-by: Magnus Karlsson <magnus.karlsson@...el.com>
> ---
[...]
> 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@...el.com>
> };
>
> /* 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
Powered by blists - more mailing lists