diff options
author | Wei Wang <weiwan@google.com> | 2021-09-29 19:25:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-30 14:36:46 +0200 |
commit | 053f368412c9a7bfce2befec8c795113c8cfb0b1 (patch) | |
tree | 30f0da3c75f0c65934cf3e42cd43c3fb8d4d0488 /net/ipv4/tcp_output.c | |
parent | tcp: adjust sndbuf according to sk_reserved_mem (diff) | |
download | linux-053f368412c9a7bfce2befec8c795113c8cfb0b1.tar.xz linux-053f368412c9a7bfce2befec8c795113c8cfb0b1.zip |
tcp: adjust rcv_ssthresh according to sk_reserved_mem
When user sets SO_RESERVE_MEM socket option, in order to utilize the
reserved memory when in memory pressure state, we adjust rcv_ssthresh
according to the available reserved memory for the socket, instead of
using 4 * advmss always.
Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index fdc39b4fbbfa..3a01e5593a17 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2967,8 +2967,7 @@ u32 __tcp_select_window(struct sock *sk) icsk->icsk_ack.quick = 0; if (tcp_under_memory_pressure(sk)) - tp->rcv_ssthresh = min(tp->rcv_ssthresh, - 4U * tp->advmss); + tcp_adjust_rcv_ssthresh(sk); /* free_space might become our new window, make sure we don't * increase it due to wscale. |