aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2007-12-31 18:00:50 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:00:27 -0500
commit680a5a5086443b9547b32b04f40af8f9d717f711 (patch)
tree86b2a38732d03970e5d30ada9d5459a752cf1210 /net/core
parentd436d68630a74ba3c898ff1b53591ddc4eb7f2bf (diff)
[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>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c2
1 files changed, 1 insertions, 1 deletions
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)
1476{ 1476{
1477 struct proto *prot = sk->sk_prot; 1477 struct proto *prot = sk->sk_prot;
1478 1478
1479 atomic_sub(sk->sk_forward_alloc / SK_MEM_QUANTUM, 1479 atomic_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT,
1480 prot->memory_allocated); 1480 prot->memory_allocated);
1481 sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1; 1481 sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
1482 1482