mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fe3f8b6716
commit
7613c06ffa
@@ -422,6 +422,12 @@ static struct page *__page_pool_alloc_pages_slow(struct page_pool *pool,
|
||||
struct page *page;
|
||||
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_pool_alloc_page_order(pool, gfp);
|
||||
|
||||
Reference in New Issue
Block a user