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

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;