Skip to contentSkip to conversation

net: use skb_clone to avoid alloc_pages failure.

PATCH Applied [email protected] 3 participants 4 messages Nov 17, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: use skb_clone to avoid alloc_pages failure.

From: Martin Zhang <[email protected]>

1. new skb only need dst and ip address(v4 or v6).
2. skb_copy may need high order pages, which is very rare on long running server.

---

 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/neighbour.c +1 -1
index 1aa8437..e6af42d 100644
@@ -857,7 +857,7 @@ static void neigh_probe(struct neighbour *neigh)
 	struct sk_buff *skb = skb_peek_tail(&neigh->arp_queue);
 	/* keep skb alive even if arp_queue overflows */
 	if (skb)
-		skb = skb_copy(skb, GFP_ATOMIC);
+		skb = skb_clone(skb, GFP_ATOMIC);
 	write_unlock(&neigh->lock);
 	neigh->ops->solicit(neigh, skb);
 	atomic_inc(&neigh->probes);
Signature · 1 line
2.1.4
#2 lore raw
Quoted 12 lines · Eric Dumazet
Quoted 8 lines · On Tue, 2015-11-17 at 20:49 +0800, [email protected] wrote:

From: Martin Zhang <[email protected]>

1. new skb only need dst and ip address(v4 or v6).
2. skb_copy may need high order pages, which is very rare on long running server.

---

BTW, very nice catch, thanks guys !