Skip to content

Commit 85bdf7d

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: make tcp_space() aware of socket backlog
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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Tested-by: Jean-Louis Dupond<[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 19119f2 commit 85bdf7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ static inline int tcp_win_from_space(const struct sock *sk, int space)
13681368
/* Note: caller must be prepared to deal with negative returns */
13691369
static inline int tcp_space(const struct sock *sk)
13701370
{
1371-
return tcp_win_from_space(sk, sk->sk_rcvbuf -
1371+
return tcp_win_from_space(sk, sk->sk_rcvbuf - sk->sk_backlog.len -
13721372
atomic_read(&sk->sk_rmem_alloc));
13731373
}
13741374

0 commit comments

Comments
 (0)