From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Louis Dupond Subject: Re: [PATCH v3 net-next 3/4] tcp: make tcp_space() aware of socket backlog Date: Wed, 28 Nov 2018 15:54:13 +0100 Message-ID: References: <20181127224203.69999-1-edumazet@google.com> <20181127224203.69999-4-edumazet@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev , Neal Cardwell , Yuchung Cheng , Eric Dumazet To: Eric Dumazet , "David S . Miller" Return-path: Received: from apollo.dupie.be ([62.210.113.39]:47282 "EHLO apollo.dupie.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728031AbeK2B4M (ORCPT ); Wed, 28 Nov 2018 20:56:12 -0500 In-Reply-To: <20181127224203.69999-4-edumazet@google.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 27/11/18 23:42, Eric Dumazet wrote: > 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 > Signed-off-by: Eric Dumazet > Acked-by: Neal Cardwell > Acked-by: Yuchung Cheng > --- > 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 0c61bf0a06dac95268c26b6302a2afbaef4c88b3..3b522259da7d5a54d7d3730ddd8d8c9ef24313e1 100644 > --- a/include/net/tcp.h > +++ b/include/net/tcp.h > @@ -1368,7 +1368,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)); > } > Tested-by: Jean-Louis Dupond Big difference in performance :) Thanks a lot!