page_pool: always add GFP_NOWARN for ATOMIC allocations
Subsystems (3)
Jakub Kicinski
maintainerPATCH v2 1/1 page_pool: always add GFP_NOWARN for ATOMIC allocations
Driver authors often forget to add GFP_NOWARN for page allocation from the datapath. This is annoying to users as OOMs are a fact of life, and we pretty much expect network Rx to hit page allocation failures during OOM. Make page pool add GFP_NOWARN for ATOMIC allocations by default.
---
v2:
- drop the micro-optimization
v1: https://lore.kernel.org/[email protected]
--- net/core/page_pool.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/core/page_pool.c +6 -0
@@ -555,6 +555,12 @@ static noinline netmem_ref __page_pool_alloc_netmems_slow(struct page_pool *poolnetmem_ref netmem;int i, nr_pages; +/* Unconditionally set NOWARN if allocating from NAPI. +* Drivers forget to set it, and OOM reports on packet Rx are useless. +*/ +if ((gfp &GFP_ATOMIC ) ==GFP_ATOMIC ) + gfp |= __GFP_NOWARN; +/* Don't support bulk alloc for high-order pages */ if (unlikely (pp_order))return page_to_netmem (__page_pool_alloc_page_order (pool, gfp));
Signature · 1 line
2.51.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Fri, 12 Sep 2025 09:17:03 -0700 you wrote:
Driver authors often forget to add
GFP_NOWARNfor page allocation from the datapath. This is annoying to users as OOMs are a fact of life, and we pretty much expect network Rx to hit page allocation failures during OOM. Make page pool addGFP_NOWARNfor ATOMIC allocations by default.Reviewed-by Mina Almasry <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net-next,v2] page_pool: always add GFP_NOWARN for ATOMIC allocations
https://git.kernel.org/netdev/net-next/c/f3b52167a0cb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html