diff options
author | David S. Miller <davem@davemloft.net> | 2015-05-17 22:45:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-17 22:46:26 -0400 |
commit | 5d48ef3e954cae2f237ff8e006322d2f3b672375 (patch) | |
tree | 13db6cdf2a7ff4f841f3ec44b5700a8e9af1b361 /include/net/sock.h | |
parent | 4633c9e07b3b7d7fc262a5f59ff635c1f702af6f (diff) | |
parent | b66e91ccbc34ebd5a2f90f9e1bc1597e2924a500 (diff) | |
download | talos-op-linux-5d48ef3e954cae2f237ff8e006322d2f3b672375.tar.gz talos-op-linux-5d48ef3e954cae2f237ff8e006322d2f3b672375.zip |
Merge branch 'tcp_mem_pressure'
Eric Dumazet says:
====================
tcp: better handling of memory pressure
When testing commit 790ba4566c1a ("tcp: set SOCK_NOSPACE under memory
pressure") using edge triggered epoll applications, I found various
issues under memory pressure and thousands of active sockets.
This patch series is a first round to solve these issues, in send
and receive paths. There are probably other fixes needed, but
with this series, my tests now all succeed.
v2: fix typo in "allow one skb to be received per socket under memory pressure",
as spotted by Jason Baron.
====================
Acked-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index d882f4c8e438..4581a60636f8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1368,7 +1368,7 @@ static inline struct inode *SOCK_INODE(struct socket *socket) * Functions for memory accounting */ int __sk_mem_schedule(struct sock *sk, int size, int kind); -void __sk_mem_reclaim(struct sock *sk); +void __sk_mem_reclaim(struct sock *sk, int amount); #define SK_MEM_QUANTUM ((int)PAGE_SIZE) #define SK_MEM_QUANTUM_SHIFT ilog2(SK_MEM_QUANTUM) @@ -1409,7 +1409,7 @@ static inline void sk_mem_reclaim(struct sock *sk) if (!sk_has_account(sk)) return; if (sk->sk_forward_alloc >= SK_MEM_QUANTUM) - __sk_mem_reclaim(sk); + __sk_mem_reclaim(sk, sk->sk_forward_alloc); } static inline void sk_mem_reclaim_partial(struct sock *sk) @@ -1417,7 +1417,7 @@ 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); + __sk_mem_reclaim(sk, sk->sk_forward_alloc - 1); } static inline void sk_mem_charge(struct sock *sk, int size) |