Commit 29fbc26e authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: do not call tcp_cleanup_rbuf() if we have a backlog

Under pressure, tcp recvmsg() has logic to process the socket backlog,
but calls tcp_cleanup_rbuf() right before.

Avoiding sending ACK right before processing new segments makes
a lot of sense, as this decrease the number of ACK packets,
with no impact on effective ACK clocking.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8bd172b7
...@@ -2436,12 +2436,11 @@ static int tcp_recvmsg_locked(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -2436,12 +2436,11 @@ static int tcp_recvmsg_locked(struct sock *sk, struct msghdr *msg, size_t len,
} }
} }
tcp_cleanup_rbuf(sk, copied);
if (copied >= target) { if (copied >= target) {
/* Do not sleep, just process backlog. */ /* Do not sleep, just process backlog. */
__sk_flush_backlog(sk); __sk_flush_backlog(sk);
} else { } else {
tcp_cleanup_rbuf(sk, copied);
sk_defer_free_flush(sk); sk_defer_free_flush(sk);
sk_wait_data(sk, &timeo, last); sk_wait_data(sk, &timeo, last);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment