net: cleanup gfp mask in alloc_skb_with_frags
Subsystems (2)
PATCH 1/1 net: cleanup gfp mask in alloc_skb_with_frags
From: Michal Hocko <[email protected]>
alloc_skb_with_frags uses __GFP_NORETRY for non-sleeping allocations which is just a noop and a little bit confusing.
__GFP_NORETRY was added by ed98df3361f0 ("net: use __GFP_NORETRY for high order allocations") to prevent from the OOM killer. Yet this was not enough because fb05e7a89f50 ("net: don't wait for order-3 page allocation") didn't want an excessive reclaim for non-costly orders so it made it completely NOWAIT while it preserved __GFP_NORETRY in place which is now redundant.
Drop the pointless __GFP_NORETRY because this function is used as copy&paste source for other places.
--- net/core/skbuff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/core/skbuff.c +1 -2
@@ -5276,8 +5276,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,if (npages >=1 << order) { page =alloc_pages ((gfp_mask & ~__GFP_DIRECT_RECLAIM) | __GFP_COMP | - __GFP_NOWARN | - __GFP_NORETRY, + __GFP_NOWARN, order);if (page) goto fill_page;
Signature · 1 line
2.18.0
From: Michal Hocko <[email protected]>
Date: Thu, 28 Jun 2018 17:53:06 +0200
Quoted 12 lines
From: Michal Hocko <[email protected]>
alloc_skb_with_fragsuses__GFP_NORETRYfor non-sleeping allocations which is just a noop and a little bit confusing.
__GFP_NORETRYwas added byed98df3361f0("net: use__GFP_NORETRYfor high order allocations") to prevent from the OOM killer. Yet this was not enough becausefb05e7a89f50("net: don't wait for order-3 page allocation") didn't want an excessive reclaim for non-costly orders so it made it completely NOWAIT while it preserved__GFP_NORETRYin place which is now redundant.
Quoted 5 lines
Drop the pointless
__GFP_NORETRYbecause this function is used as copy&paste source for other places.Reviewed-by Eric Dumazet <[email protected]>Signed-off-by Michal Hocko <[email protected]>
Applied.