mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 04:03:58 +08:00
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>
This commit is contained in:
parent
7ba4291007
commit
d361fd599a
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user