From: Eric Dumazet Date: Mon, 31 Dec 2007 23:00:50 +0000 (-0800) Subject: [PATCH] use SK_MEM_QUANTUM_SHIFT in __sk_mem_reclaim() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=680a5a5086443b9547b32b04f40af8f9d717f711;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.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 Signed-off-by: David S. Miller --- diff --git a/net/core/sock.c b/net/core/sock.c index 8c184c4a3811..3804e7df626b 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -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;