Message ID | 20211115190249.3936899-20-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | tcp: optimizations for linux-5.17 | expand |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 7b1886103556e1295d84378d5bcb0f0346651de0..d1949fdb1462b97b87b99bc32ea132c574e9b647 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -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) { /* Do not sleep, just process backlog. */ __sk_flush_backlog(sk); } else { + tcp_cleanup_rbuf(sk, copied); sk_defer_free_flush(sk); sk_wait_data(sk, &timeo, last); }