diff options
author | David S. Miller <davem@davemloft.net> | 2008-01-11 00:56:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:42 -0500 |
commit | 9993e7d313e80bdc005d09c7def91903e0068f07 (patch) | |
tree | ed7c65b35fd3392948ab2f6b225f69225fdcbba8 /include/net/sock.h | |
parent | e186932b3d26bd975022a1e254407e95dddceae7 (diff) |
[TCP]: Do not purge sk_forward_alloc entirely in tcp_delack_timer().
Otherwise we beat heavily on the global tcp_memory atomics
when all of the sockets in the system are slowly sending
perioding packet clumps.
Noticed and suggested by Eric Dumazet.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 786fae858e77..902324488d0f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -759,6 +759,14 @@ static inline void sk_mem_reclaim(struct sock *sk) | |||
759 | __sk_mem_reclaim(sk); | 759 | __sk_mem_reclaim(sk); |
760 | } | 760 | } |
761 | 761 | ||
762 | static inline void sk_mem_reclaim_partial(struct sock *sk) | ||
763 | { | ||
764 | if (!sk_has_account(sk)) | ||
765 | return; | ||
766 | if (sk->sk_forward_alloc > SK_MEM_QUANTUM) | ||
767 | __sk_mem_reclaim(sk); | ||
768 | } | ||
769 | |||
762 | static inline void sk_mem_charge(struct sock *sk, int size) | 770 | static inline void sk_mem_charge(struct sock *sk, int size) |
763 | { | 771 | { |
764 | if (!sk_has_account(sk)) | 772 | if (!sk_has_account(sk)) |