net: skbuff: sprinkle more __GFP_NOWARN on ingress allocs

BugLink: https://bugs.launchpad.net/bugs/2097301

[ Upstream commit c89cca307b20917da739567a255a68a0798ee129 ]

build_skb() and frag allocations done with GFP_ATOMIC will
fail in real life, when system is under memory pressure,
and there's nothing we can do about that. So no point
printing warnings.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
This commit is contained in:
Jakub Kicinski
2024-08-01 17:19:56 -07:00
committed by Mehmet Basaran
parent b5a3caa419
commit 58f221656d
+6 -6
View File
@@ -297,7 +297,7 @@ void *__napi_alloc_frag_align(unsigned int fragsz, unsigned int align_mask)
fragsz = SKB_DATA_ALIGN(fragsz);
return page_frag_alloc_align(&nc->page, fragsz, GFP_ATOMIC, align_mask);
return page_frag_alloc_align(&nc->page, fragsz, GFP_ATOMIC | __GFP_NOWARN, align_mask);
}
EXPORT_SYMBOL(__napi_alloc_frag_align);
@@ -309,13 +309,13 @@ void *__netdev_alloc_frag_align(unsigned int fragsz, unsigned int align_mask)
if (in_hardirq() || irqs_disabled()) {
struct page_frag_cache *nc = this_cpu_ptr(&netdev_alloc_cache);
data = page_frag_alloc_align(nc, fragsz, GFP_ATOMIC, align_mask);
data = page_frag_alloc_align(nc, fragsz, GFP_ATOMIC | __GFP_NOWARN, align_mask);
} else {
struct napi_alloc_cache *nc;
local_bh_disable();
nc = this_cpu_ptr(&napi_alloc_cache);
data = page_frag_alloc_align(&nc->page, fragsz, GFP_ATOMIC, align_mask);
data = page_frag_alloc_align(&nc->page, fragsz, GFP_ATOMIC | __GFP_NOWARN, align_mask);
local_bh_enable();
}
return data;
@@ -329,7 +329,7 @@ static struct sk_buff *napi_skb_cache_get(void)
if (unlikely(!nc->skb_count)) {
nc->skb_count = kmem_cache_alloc_bulk(skbuff_cache,
GFP_ATOMIC,
GFP_ATOMIC | __GFP_NOWARN,
NAPI_SKB_CACHE_BULK,
nc->skb_cache);
if (unlikely(!nc->skb_count))
@@ -395,7 +395,7 @@ struct sk_buff *slab_build_skb(void *data)
struct sk_buff *skb;
unsigned int size;
skb = kmem_cache_alloc(skbuff_cache, GFP_ATOMIC);
skb = kmem_cache_alloc(skbuff_cache, GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
return NULL;
@@ -446,7 +446,7 @@ struct sk_buff *__build_skb(void *data, unsigned int frag_size)
{
struct sk_buff *skb;
skb = kmem_cache_alloc(skbuff_cache, GFP_ATOMIC);
skb = kmem_cache_alloc(skbuff_cache, GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
return NULL;