From 9993e7d313e80bdc005d09c7def91903e0068f07 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 10 Jan 2008 21:56:38 -0800 Subject: [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 --- include/net/sock.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/net/sock.h') diff --git a/include/net/sock.h b/include/net/sock.h index 786fae858e7..902324488d0 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -759,6 +759,14 @@ static inline void sk_mem_reclaim(struct sock *sk) __sk_mem_reclaim(sk); } +static inline void sk_mem_reclaim_partial(struct sock *sk) +{ + if (!sk_has_account(sk)) + return; + if (sk->sk_forward_alloc > SK_MEM_QUANTUM) + __sk_mem_reclaim(sk); +} + static inline void sk_mem_charge(struct sock *sk, int size) { if (!sk_has_account(sk)) -- cgit v1.2.3