tcp: adjust sndbuf according to sk_reserved_mem
authorWei Wang <weiwan@google.com>
Wed, 29 Sep 2021 17:25:12 +0000 (10:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Sep 2021 12:36:46 +0000 (13:36 +0100)
commitca057051cf25a8c198af7b73daf922ef65a3c016
tree3454d2e3c12770adc387078b79f9f0f8434b04b6
parent2bb2f5fb21b0486ff69b7b4a1fe03a760527d133
tcp: adjust sndbuf according to sk_reserved_mem

If user sets SO_RESERVE_MEM socket option, in order to fully utilize the
reserved memory in memory pressure state on the tx path, we modify the
logic in sk_stream_moderate_sndbuf() to set sk_sndbuf according to
available reserved memory, instead of MIN_SOCK_SNDBUF, and adjust it
when new data is acked.

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>
include/net/sock.h
net/ipv4/tcp_input.c