From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: netdev@vger.kernel.org, "Björn Töpel" <bjorn@kernel.org>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
bpf@vger.kernel.org
Subject: Re: [PATCH net-next v4] xsk: support use vaddr as ring
Date: Thu, 16 Feb 2023 14:04:47 +0100 [thread overview]
Message-ID: <779078a5-a4c8-6f75-2063-912d02e47bc7@intel.com> (raw)
In-Reply-To: <20230216083047.93525-1-xuanzhuo@linux.alibaba.com>
From: Xuan Zhuo <xuanzhuo@linux.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@linux.alibaba.com>
> Acked-by: Magnus Karlsson <magnus.karlsson@intel.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@intel.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
next prev parent reply other threads:[~2023-02-16 13:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 8:30 [PATCH net-next v4] xsk: support use vaddr as ring Xuan Zhuo
2023-02-16 13:04 ` Alexander Lobakin [this message]
2023-02-17 8:59 ` Xuan Zhuo
2023-02-20 8:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=779078a5-a4c8-6f75-2063-912d02e47bc7@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox