All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Jean-Louis Dupond <jean-louis@dupond.be>,
	Neal Cardwell <ncardwell@google.com>,
	Yuchung Cheng <ycheng@google.com>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v3 net-next 3/4] tcp: make tcp_space() aware of socket backlog
Date: Tue, 27 Nov 2018 14:42:02 -0800	[thread overview]
Message-ID: <20181127224203.69999-4-edumazet@google.com> (raw)
In-Reply-To: <20181127224203.69999-1-edumazet@google.com>

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 <jean-louis@dupond.be>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
---
 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));
 }
 
-- 
2.20.0.rc0.387.gc7a69e6b6c-goog

  parent reply	other threads:[~2018-11-28  9:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 22:41 [PATCH v3 net-next 0/4] tcp: take a bit more care of backlog stress Eric Dumazet
2018-11-27 22:42 ` [PATCH v3 net-next 1/4] tcp: hint compiler about sack flows Eric Dumazet
2018-11-27 22:42 ` [PATCH v3 net-next 2/4] tcp: take care of compressed acks in tcp_add_reno_sack() Eric Dumazet
2018-11-28 16:41   ` Neal Cardwell
2018-11-27 22:42 ` Eric Dumazet [this message]
2018-11-28 14:54   ` [PATCH v3 net-next 3/4] tcp: make tcp_space() aware of socket backlog Jean-Louis Dupond
2018-11-27 22:42 ` [PATCH v3 net-next 4/4] tcp: implement coalescing on backlog queue Eric Dumazet
2018-11-28 16:46   ` Neal Cardwell
2018-11-30 21:27 ` [PATCH v3 net-next 0/4] tcp: take a bit more care of backlog stress David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181127224203.69999-4-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jean-louis@dupond.be \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.