Commit 9993e7d313e80bdc005d09c7def91903e0068f07
1 parent
e186932b3d
Exists in
master
and in
7 other branches
[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>
Showing 2 changed files with 9 additions and 1 deletions Side-by-side Diff
include/net/sock.h
... | ... | @@ -759,6 +759,14 @@ |
759 | 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 | 770 | static inline void sk_mem_charge(struct sock *sk, int size) |
763 | 771 | { |
764 | 772 | if (!sk_has_account(sk)) |