summaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-07-10 22:45:17 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-12 20:21:46 -0700
commitd361fd599a991ff6c1d522a599c635b35d61ef30 (patch)
tree6dd438dc6b818a5f08a0213590f3b21ebd00d6cb /net/core/sock.c
parent7ba42910073f8432934d61a6c08b1023c408fb62 (diff)
downloadblackbird-op-linux-d361fd599a991ff6c1d522a599c635b35d61ef30.tar.gz
blackbird-op-linux-d361fd599a991ff6c1d522a599c635b35d61ef30.zip
net: sock_free() optimizations
Avoid two extra instructions in sock_free(), to reload skb->truesize and skb->sk Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c5
1 files changed, 3 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud