mirror of https://gitee.com/openkylin/linux.git
[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: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d436d68630
commit
680a5a5086
|
@ -1476,7 +1476,7 @@ void __sk_mem_reclaim(struct sock *sk)
|
||||||
{
|
{
|
||||||
struct proto *prot = sk->sk_prot;
|
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);
|
prot->memory_allocated);
|
||||||
sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
|
sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue