From: Eric Dumazet <eduma...@google.com> Date: Tue, 4 Dec 2018 07:58:17 -0800
> TCP_NOTSENT_LOWAT socket option or sysctl was added in linux-3.12 > as a step to enable bigger tcp sndbuf limits. > > It works reasonably well, but the following happens : > > Once the limit is reached, TCP stack generates > an [E]POLLOUT event for every incoming ACK packet. > > This causes a high number of context switches. > > This patch implements the strategy David Miller added > in sock_def_write_space() : > > - If TCP socket has a notsent_lowat constraint of X bytes, > allow sendmsg() to fill up to X bytes, but send [E]POLLOUT > only if number of notsent bytes is below X/2 > > This considerably reduces TCP_NOTSENT_LOWAT overhead, > while allowing to keep the pipe full. ... > Signed-off-by: Eric Dumazet <eduma...@google.com> > Acked-by: Soheil Hassas Yeganeh <soh...@google.com> Applied, thanks Eric.