Skip to contentSkip to conversation

tcp: start receiver buffer autotuning sooner

PATCH Applied Yuchung Cheng 2 participants 3 messages Oct 2, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: start receiver buffer autotuning sooner

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")
---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_input.c +1 -1
index 7a59f6a96212..bf1aac315490 100644
@@ -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;
Signature · 1 line
2.19.0.605.g01d371f741-goog
maintainer Applied
#1 lore raw

From: Yuchung Cheng <[email protected]>
Date: Mon, 1 Oct 2018 15:42:32 -0700

Quoted 8 lines

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.

Quoted 6 lines
Fixes a337531b942b ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB")

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

#2 lore raw
Quoted 18 lines · David Miller

From: Yuchung Cheng <[email protected]>
Date: Mon, 1 Oct 2018 15:42:32 -0700

Quoted 8 lines

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.

Quoted 6 lines
Fixes a337531b942b ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB")
Quoted 2 lines

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

No problem thanks for the fast response!