public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: pin system percpu page_pools to the corresponding NUMA nodes
@ 2024-03-25 16:06 Alexander Lobakin
  2024-03-27  4:09 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Lobakin @ 2024-03-25 16:06 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Alexander Lobakin, Lorenzo Bianconi,
	Toke Høiland-Jørgensen,
	nex.sw.ncis.osdt.itp.upstreaming, netdev, linux-kernel

System page_pools are percpu and one instance can be used only on
one CPU.
%NUMA_NO_NODE is fine for allocating pages, as the PP core always
allocates local pages in this case. But for the struct &page_pool
itself, this node ID means they are allocated on the boot CPU,
which may belong to a different node than the target CPU.
Pin system page_pools to the corresponding nodes when creating,
so that all the allocated data will always be local. Use
cpu_to_mem() to account memless nodes.
Nodes != 0 win some Kpps when testing with xdp-trafficgen.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 9a67003e49db..fefa484d715a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11712,7 +11712,7 @@ static int net_page_pool_create(int cpuid)
 	struct page_pool_params page_pool_params = {
 		.pool_size = SYSTEM_PERCPU_PAGE_POOL_SIZE,
 		.flags = PP_FLAG_SYSTEM_POOL,
-		.nid = NUMA_NO_NODE,
+		.nid = cpu_to_mem(cpuid),
 	};
 	struct page_pool *pp_ptr;
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: pin system percpu page_pools to the corresponding NUMA nodes
  2024-03-25 16:06 [PATCH net-next] net: pin system percpu page_pools to the corresponding NUMA nodes Alexander Lobakin
@ 2024-03-27  4:09 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-27  4:09 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: davem, edumazet, kuba, pabeni, lorenzo, toke,
	nex.sw.ncis.osdt.itp.upstreaming, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 25 Mar 2024 17:06:35 +0100 you wrote:
> System page_pools are percpu and one instance can be used only on
> one CPU.
> %NUMA_NO_NODE is fine for allocating pages, as the PP core always
> allocates local pages in this case. But for the struct &page_pool
> itself, this node ID means they are allocated on the boot CPU,
> which may belong to a different node than the target CPU.
> Pin system page_pools to the corresponding nodes when creating,
> so that all the allocated data will always be local. Use
> cpu_to_mem() to account memless nodes.
> Nodes != 0 win some Kpps when testing with xdp-trafficgen.
> 
> [...]

Here is the summary with links:
  - [net-next] net: pin system percpu page_pools to the corresponding NUMA nodes
    https://git.kernel.org/netdev/net-next/c/341ee1a584c8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-27  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 16:06 [PATCH net-next] net: pin system percpu page_pools to the corresponding NUMA nodes Alexander Lobakin
2024-03-27  4:09 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox