Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d361fd59 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: sock_free() optimizations



Avoid two extra instructions in sock_free(), to reload
skb->truesize and skb->sk

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ba42910
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);