]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tcp: make tcp_space() aware of socket backlog
authorEric Dumazet <edumazet@google.com>
Tue, 27 Nov 2018 22:42:02 +0000 (14:42 -0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:00 +0000 (14:23 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/net/tcp.h

index 2eb12f29ed90ff233fa33eb116e52c40f6732d70..4071ec60e9903b3f0357151feea406be363fdc04 100644 (file)
@@ -1301,7 +1301,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));
 }