[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.19 152/243] tcp: make tcp_space() aware of socket backlog
From: Eric Dumazet <>

[ 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

Reported-by: Jean-Louis Dupond <>
Signed-off-by: Eric Dumazet <>
Acked-by: Neal Cardwell <>
Acked-by: Yuchung Cheng <>
Tested-by: Jean-Louis Dupond<>
Signed-off-by: David S. Miller <>
Signed-off-by: Sasha Levin <>
include/net/tcp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index abcf53a6db045..3f4223a550d92 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 -


 \ /
  Last update: 2019-12-11 16:50    [W:0.752 / U:2.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site