A network driver can allocate socket buffers in a softirq context but
if the allocation fails then a warning will be produced to the dmesg.
A lot of such warnings could slow down the whole system as a printing
to dmesg can be very time-consuming (especially in a situation of low
memory). Also network drivers usually have appropriate stats counter
(like 'alloc_rx_buff_failed') which can be obtained using ethtool.

Suppress this warnings using __GFP_NOWARN flag.

https://jira.sw.ru/browse/PSBM-82315
Signed-off-by: Oleg Babin <oba...@virtuozzo.com>
---
 include/linux/skbuff.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index fd8e26d..eef76c3 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2440,7 +2440,7 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi,
 static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi,
                                             unsigned int length)
 {
-       return __napi_alloc_skb(napi, length, GFP_ATOMIC);
+       return __napi_alloc_skb(napi, length, GFP_ATOMIC | __GFP_NOWARN);
 }
 void napi_consume_skb(struct sk_buff *skb, int budget);
 
-- 
1.8.3.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to