All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: start receiver buffer autotuning sooner
@ 2018-10-01 22:42 Yuchung Cheng
  2018-10-01 22:46 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Yuchung Cheng @ 2018-10-01 22:42 UTC (permalink / raw)
  To: davem, edumazet; +Cc: netdev, ncardwell, weiwan, soheil, Yuchung Cheng

Previously receiver buffer auto-tuning starts after receiving
one advertised window amount of data. After the initial receiver
buffer was raised by patch a337531b942b ("tcp: up initial rmem to
128KB and SYN rwin to around 64KB"), the reciver buffer may take
too long to start raising. To address this issue, this patch lowers
the initial bytes expected to receive roughly the expected sender's
initial window.

Fixes: a337531b942b ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB")
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>
---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7a59f6a96212..bf1aac315490 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -438,7 +438,7 @@ void tcp_init_buffer_space(struct sock *sk)
 	if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK))
 		tcp_sndbuf_expand(sk);
 
-	tp->rcvq_space.space = tp->rcv_wnd;
+	tp->rcvq_space.space = min_t(u32, tp->rcv_wnd, TCP_INIT_CWND * tp->advmss);
 	tcp_mstamp_refresh(tp);
 	tp->rcvq_space.time = tp->tcp_mstamp;
 	tp->rcvq_space.seq = tp->copied_seq;
-- 
2.19.0.605.g01d371f741-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tcp: start receiver buffer autotuning sooner
  2018-10-01 22:42 [PATCH net-next] tcp: start receiver buffer autotuning sooner Yuchung Cheng
@ 2018-10-01 22:46 ` David Miller
  2018-10-01 23:07   ` Yuchung Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2018-10-01 22:46 UTC (permalink / raw)
  To: ycheng; +Cc: edumazet, netdev, ncardwell, weiwan, soheil

From: Yuchung Cheng <ycheng@google.com>
Date: Mon,  1 Oct 2018 15:42:32 -0700

> Previously receiver buffer auto-tuning starts after receiving
> one advertised window amount of data. After the initial receiver
> buffer was raised by patch a337531b942b ("tcp: up initial rmem to
> 128KB and SYN rwin to around 64KB"), the reciver buffer may take
> too long to start raising. To address this issue, this patch lowers
> the initial bytes expected to receive roughly the expected sender's
> initial window.
> 
> Fixes: a337531b942b ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB")
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>

Applied, sorry for applying v1 instead of v2 the the rmem increasing patch.
:-/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tcp: start receiver buffer autotuning sooner
  2018-10-01 22:46 ` David Miller
@ 2018-10-01 23:07   ` Yuchung Cheng
  0 siblings, 0 replies; 3+ messages in thread
From: Yuchung Cheng @ 2018-10-01 23:07 UTC (permalink / raw)
  To: David Miller
  Cc: Eric Dumazet, netdev, Neal Cardwell, Wei Wang, Soheil Hassas Yeganeh

On Mon, Oct 1, 2018 at 3:46 PM, David Miller <davem@davemloft.net> wrote:
> From: Yuchung Cheng <ycheng@google.com>
> Date: Mon,  1 Oct 2018 15:42:32 -0700
>
>> Previously receiver buffer auto-tuning starts after receiving
>> one advertised window amount of data. After the initial receiver
>> buffer was raised by patch a337531b942b ("tcp: up initial rmem to
>> 128KB and SYN rwin to around 64KB"), the reciver buffer may take
>> too long to start raising. To address this issue, this patch lowers
>> the initial bytes expected to receive roughly the expected sender's
>> initial window.
>>
>> Fixes: a337531b942b ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB")
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> Signed-off-by: Wei Wang <weiwan@google.com>
>> Signed-off-by: Neal Cardwell <ncardwell@google.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>
>
> Applied, sorry for applying v1 instead of v2 the the rmem increasing patch.
> :-/
No problem thanks for the fast response!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-02  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 22:42 [PATCH net-next] tcp: start receiver buffer autotuning sooner Yuchung Cheng
2018-10-01 22:46 ` David Miller
2018-10-01 23:07   ` Yuchung Cheng

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.