diff mbox series

[net-next] net: pin system percpu page_pools to the corresponding NUMA nodes

Message ID 20240325160635.3215855-1-aleksander.lobakin@intel.com (mailing list archive)
State Accepted
Commit 341ee1a584c8f55068cc5d7024cf1711ab81e388
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: pin system percpu page_pools to the corresponding NUMA nodes | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 951 this patch: 951
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: daniel@iogearbox.net john.fastabend@gmail.com ast@kernel.org hawk@kernel.org bpf@vger.kernel.org
netdev/build_clang success Errors and warnings before: 956 this patch: 956
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 962 this patch: 962
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-27--00-00 (tests: 948)

Commit Message

Alexander Lobakin March 25, 2024, 4:06 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 27, 2024, 4:09 a.m. UTC | #1
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!
diff mbox series

Patch

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;