On Sat, Aug 27, 2016 at 10:37 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > From: Eric Dumazet <eduma...@google.com> > > When TCP operates in lossy environments (between 1 and 10 % packet > losses), many SACK blocks can be exchanged, and I noticed we could > drop them on busy senders, if these SACK blocks have to be queued > into the socket backlog. > > While the main cause is the poor performance of RACK/SACK processing, > we can try to avoid these drops of valuable information that can lead to > spurious timeouts and retransmits. > > Cause of the drops is the skb->truesize overestimation caused by : > > - drivers allocating ~2048 (or more) bytes as a fragment to hold an > Ethernet frame. > > - various pskb_may_pull() calls bringing the headers into skb->head > might have pulled all the frame content, but skb->truesize could > not be lowered, as the stack has no idea of each fragment truesize. > > The backlog drops are also more visible on bidirectional flows, since > their sk_rmem_alloc can be quite big. > > Let's add some room for the backlog, as only the socket owner > can selectively take action to lower memory needs, like collapsing > receive queues or partial ofo pruning. > > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Yuchung Cheng <ych...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > --- > include/net/tcp.h | 1 + > net/ipv4/tcp_ipv4.c | 33 +++++++++++++++++++++++++++++---- > net/ipv6/tcp_ipv6.c | 5 +---- > 3 files changed, 31 insertions(+), 8 deletions(-) > > diff --git a/include/net/tcp.h b/include/net/tcp.h > index > 25d64f6de69e1f639ed1531bf2d2df3f00fd76a2..5f5f09f6e019682ef29c864d2f43a8f247fcdd9a > 100644
Thanks for doing this, and thanks for the detailed answers to Yuchung's e-mail! Acked-by: Neal Cardwell <ncardw...@google.com> neal