* [PATCH net-next] tcp: remove mss check in tcp_select_initial_window()
@ 2018-04-26 16:58 Wei Wang
2018-04-26 17:05 ` Neal Cardwell
2018-04-27 18:05 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Wei Wang @ 2018-04-26 16:58 UTC (permalink / raw)
To: David Miller, netdev
Cc: Yuchung Cheng, Eric Dumazet, Soheil Hassas Yeganeh, Wei Wang
From: Wei Wang <weiwan@google.com>
In tcp_select_initial_window(), we only set rcv_wnd to
tcp_default_init_rwnd() if current mss > (1 << wscale). Otherwise,
rcv_wnd is kept at the full receive space of the socket which is a
value way larger than tcp_default_init_rwnd().
With larger initial rcv_wnd value, receive buffer autotuning logic
takes longer to kick in and increase the receive buffer.
In a TCP throughput test where receiver has rmem[2] set to 125MB
(wscale is 11), we see the connection gets recvbuf limited at the
beginning of the connection and gets less throughput overall.
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
---
net/ipv4/tcp_output.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 95feffb6d53f..d07c0dcc99aa 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -229,11 +229,9 @@ void tcp_select_initial_window(const struct sock *sk, int __space, __u32 mss,
}
}
- if (mss > (1 << *rcv_wscale)) {
- if (!init_rcv_wnd) /* Use default unless specified otherwise */
- init_rcv_wnd = tcp_default_init_rwnd(mss);
- *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
- }
+ if (!init_rcv_wnd) /* Use default unless specified otherwise */
+ init_rcv_wnd = tcp_default_init_rwnd(mss);
+ *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
/* Set the clamp no higher than max representable value */
(*window_clamp) = min_t(__u32, U16_MAX << (*rcv_wscale), *window_clamp);
--
2.17.0.484.g0c8726318c-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] tcp: remove mss check in tcp_select_initial_window()
2018-04-26 16:58 [PATCH net-next] tcp: remove mss check in tcp_select_initial_window() Wei Wang
@ 2018-04-26 17:05 ` Neal Cardwell
2018-04-27 18:05 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Neal Cardwell @ 2018-04-26 17:05 UTC (permalink / raw)
To: Wei Wang
Cc: David Miller, Netdev, Yuchung Cheng, Eric Dumazet,
Soheil Hassas Yeganeh
On Thu, Apr 26, 2018 at 12:58 PM Wei Wang <weiwan@google.com> wrote:
> From: Wei Wang <weiwan@google.com>
> In tcp_select_initial_window(), we only set rcv_wnd to
> tcp_default_init_rwnd() if current mss > (1 << wscale). Otherwise,
> rcv_wnd is kept at the full receive space of the socket which is a
> value way larger than tcp_default_init_rwnd().
> With larger initial rcv_wnd value, receive buffer autotuning logic
> takes longer to kick in and increase the receive buffer.
> In a TCP throughput test where receiver has rmem[2] set to 125MB
> (wscale is 11), we see the connection gets recvbuf limited at the
> beginning of the connection and gets less throughput overall.
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>
> ---
Acked-by: Neal Cardwell <ncardwell@google.com>
Thanks, Wei!
neal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: remove mss check in tcp_select_initial_window()
2018-04-26 16:58 [PATCH net-next] tcp: remove mss check in tcp_select_initial_window() Wei Wang
2018-04-26 17:05 ` Neal Cardwell
@ 2018-04-27 18:05 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-04-27 18:05 UTC (permalink / raw)
To: weiwan; +Cc: netdev, ycheng, edumazet, soheil
From: Wei Wang <weiwan@google.com>
Date: Thu, 26 Apr 2018 09:58:10 -0700
> From: Wei Wang <weiwan@google.com>
>
> In tcp_select_initial_window(), we only set rcv_wnd to
> tcp_default_init_rwnd() if current mss > (1 << wscale). Otherwise,
> rcv_wnd is kept at the full receive space of the socket which is a
> value way larger than tcp_default_init_rwnd().
> With larger initial rcv_wnd value, receive buffer autotuning logic
> takes longer to kick in and increase the receive buffer.
>
> In a TCP throughput test where receiver has rmem[2] set to 125MB
> (wscale is 11), we see the connection gets recvbuf limited at the
> beginning of the connection and gets less throughput overall.
>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>
Very nice commit message.
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-27 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 16:58 [PATCH net-next] tcp: remove mss check in tcp_select_initial_window() Wei Wang
2018-04-26 17:05 ` Neal Cardwell
2018-04-27 18:05 ` David Miller
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).