From: Eric Dumazet Date: Sat, 10 Jul 2010 22:45:17 +0000 (+0000) Subject: net: sock_free() optimizations X-Git-Tag: MMI-PSA29.97-13-9~23092^2~252 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d361fd599a991ff6c1d522a599c635b35d61ef30;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git net: sock_free() optimizations Avoid two extra instructions in sock_free(), to reload skb->truesize and skb->sk Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/sock.c b/net/core/sock.c index fef2434b7c8c..363bc260157c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1339,9 +1339,10 @@ EXPORT_SYMBOL(sock_wfree); void sock_rfree(struct sk_buff *skb) { struct sock *sk = skb->sk; + unsigned int len = skb->truesize; - atomic_sub(skb->truesize, &sk->sk_rmem_alloc); - sk_mem_uncharge(skb->sk, skb->truesize); + atomic_sub(len, &sk->sk_rmem_alloc); + sk_mem_uncharge(sk, len); } EXPORT_SYMBOL(sock_rfree);