summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-11-27 14:42:02 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-13 08:52:18 +0100
commit3ad3a9a24207dd868bdd20c42e23f2eed6c4cfdd (patch)
tree0c8e0a6a2f347ef0addbffb71d991b556a9d1837 /include
parent5db05cf0f6e698c11bc7dbfc0f31fb0bb23c458e (diff)
downloadlinux-stable-3ad3a9a24207dd868bdd20c42e23f2eed6c4cfdd.tar.gz
linux-stable-3ad3a9a24207dd868bdd20c42e23f2eed6c4cfdd.tar.bz2
linux-stable-3ad3a9a24207dd868bdd20c42e23f2eed6c4cfdd.zip
tcp: make tcp_space() aware of socket backlog
[ Upstream commit 85bdf7db5b53cdcc7a901db12bcb3d0063e3866d ] Jean-Louis Dupond reported poor iscsi TCP receive performance that we tracked to backlog drops. Apparently we fail to send window updates reflecting the fact that we are under stress. Note that we might lack a proper window increase when backlog is fully processed, since __release_sock() clears sk->sk_backlog.len _after_ all skbs have been processed. This should not matter in practice. If we had a significant load through socket backlog, we are in a dangerous situation. Reported-by: Jean-Louis Dupond <jean-louis@dupond.be> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Tested-by: Jean-Louis Dupond<jean-louis@dupond.be> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/tcp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index abcf53a6db04..3f4223a550d9 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1353,7 +1353,7 @@ static inline int tcp_win_from_space(const struct sock *sk, int space)
/* Note: caller must be prepared to deal with negative returns */
static inline int tcp_space(const struct sock *sk)
{
- return tcp_win_from_space(sk, sk->sk_rcvbuf -
+ return tcp_win_from_space(sk, sk->sk_rcvbuf - sk->sk_backlog.len -
atomic_read(&sk->sk_rmem_alloc));
}