]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: batch calls to sk_flush_backlog()
authorEric Dumazet <edumazet@google.com>
Fri, 9 Aug 2019 12:04:47 +0000 (05:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2019 18:03:27 +0000 (11:03 -0700)
commit6003b17502388c61cf9e86be341f09f2fafcdc33
treece7d4ee72ccb27174b86947628d34ec0317ab0fb
parent7e67e077d834badd5d26d7aa113e56215a89d648
tcp: batch calls to sk_flush_backlog()

Starting from commit 0cfb5406b3cd ("tcp: make tcp_sendmsg() aware of socket backlog")
loopback flows got hurt, because for each skb sent, the socket receives an
immediate ACK and sk_flush_backlog() causes extra work.

Intent was to not let the backlog grow too much, but we went a bit too far.

We can check the backlog every 16 skbs (about 1MB chunks)
to increase TCP over loopback performance by about 15 %

Note that the call to sk_flush_backlog() handles a single ACK,
thanks to coalescing done on backlog, but cleans the 16 skbs
found in rtx rb-tree.

Reported-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c