summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-09-12 09:17:03 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:34:25 -0500
commit3671a0775952026228ae44e096eb144bca75f8dc (patch)
tree79597f3da5712501aa420ff19297c31aceec05ef
parent0fccd5180fdf7d885a45f92e1dc6c15861f2e776 (diff)
downloadlinux-3671a0775952026228ae44e096eb144bca75f8dc.tar.gz
linux-3671a0775952026228ae44e096eb144bca75f8dc.tar.bz2
linux-3671a0775952026228ae44e096eb144bca75f8dc.zip
page_pool: always add GFP_NOWARN for ATOMIC allocations
[ Upstream commit f3b52167a0cb23b27414452fbc1278da2ee884fc ] 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. Reviewed-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20250912161703.361272-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/core/page_pool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 6a7d740b396f..cc0dce5246a2 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -586,6 +586,12 @@ static noinline netmem_ref __page_pool_alloc_pages_slow(struct page_pool *pool,
netmem_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));