Commit 680a5a50 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

[PATCH] use SK_MEM_QUANTUM_SHIFT in __sk_mem_reclaim()

Avoid an expensive divide (as done in commit
18030477e70a826b91608aee40a987bbd368fec6 but lost in commit
23821d2653111d20e75472c8c5003df1a55309a8)
Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d436d686
......@@ -1476,7 +1476,7 @@ void __sk_mem_reclaim(struct sock *sk)
{
struct proto *prot = sk->sk_prot;
atomic_sub(sk->sk_forward_alloc / SK_MEM_QUANTUM,
atomic_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT,
prot->memory_allocated);
sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment