netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bendik Rønning Opstad" <bro.devel@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org, "Eric Dumazet" <edumazet@google.com>,
	"Neal Cardwell" <ncardwell@google.com>,
	"Bendik Rønning Opstad" <bro.devel+kernel@gmail.com>,
	"Andreas Petlund" <apetlund@simula.no>,
	"Carsten Griwodz" <griff@simula.no>,
	"Jonas Markussen" <jonassm@ifi.uio.no>,
	"Kenneth Klette Jonassen" <kennetkl@ifi.uio.no>
Subject: [PATCH net-next] tcp: Fix CWV being too strict on thin streams
Date: Sat, 19 Sep 2015 01:38:23 +0200	[thread overview]
Message-ID: <1442619503-2282-1-git-send-email-bro.devel+kernel@gmail.com> (raw)

Application limited streams such as thin streams, that transmit small
amounts of payload in relatively few packets per RTT, are prevented from
growing the CWND after experiencing loss. This leads to increased
sojourn times for data segments in streams that often transmit
time-dependent data.

After the CWND is reduced due to loss, and an ACK has made room in the
send window for more packets to be transmitted, the CWND will not grow
unless there is more unsent data buffered in the output queue than the
CWND permits to be sent. That is because tcp_cwnd_validate(), which
updates tp->is_cwnd_limited, is only called in tcp_write_xmit() when at
least one packet with new data has been sent. However, if all the
buffered data in the output queue was sent within the current CWND,
is_cwnd_limited will remain false even when there is no more room in the
CWND. While the CWND is fully utilized, any new data put on the output
queue will be held back (i.e. limited by the CWND), but
tp->is_cwnd_limited will not be updated as no packets were transmitted.

Fix by updating tp->is_cwnd_limited if no packets are sent due to the
CWND being fully utilized.

Cc: Andreas Petlund <apetlund@simula.no>
Cc: Carsten Griwodz <griff@simula.no>
Cc: Jonas Markussen <jonassm@ifi.uio.no>
Cc: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
Signed-off-by: Bendik Rønning Opstad <bro.devel+kernel@gmail.com>
---
 net/ipv4/tcp_output.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index d0ad355..7096b8b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2145,6 +2145,11 @@ repair:
 		tcp_cwnd_validate(sk, is_cwnd_limited);
 		return false;
 	}
+	/* We are prevented from transmitting because we are limited
+	 * by the CWND, so update tcp sock with correct value.
+	 */
+	if (is_cwnd_limited)
+		tp->is_cwnd_limited = is_cwnd_limited;
 	return !tp->packets_out && tcp_send_head(sk);
 }
 
-- 
1.9.1

             reply	other threads:[~2015-09-18 23:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 23:38 Bendik Rønning Opstad [this message]
2015-09-19 12:46 ` [PATCH net-next] tcp: Fix CWV being too strict on thin streams Neal Cardwell
2015-09-22 14:29   ` Bendik Rønning Opstad
2015-09-22 14:46     ` Eric Dumazet
2015-09-22 16:09       ` Eric Dumazet
2015-09-22 17:11         ` Eric Dumazet
2015-09-22 18:02           ` Neal Cardwell
2015-09-22 20:04             ` Neal Cardwell
2015-09-23 14:46               ` Bendik Rønning Opstad
2015-09-23 15:34                 ` Neal Cardwell

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=1442619503-2282-1-git-send-email-bro.devel+kernel@gmail.com \
    --to=bro.devel@gmail.com \
    --cc=apetlund@simula.no \
    --cc=bro.devel+kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=griff@simula.no \
    --cc=jmorris@namei.org \
    --cc=jonassm@ifi.uio.no \
    --cc=kaber@trash.net \
    --cc=kennetkl@ifi.uio.no \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).