mbox series

[net-next,00/20] tcp: optimizations for linux-5.17

Message ID 20211115190249.3936899-1-eric.dumazet@gmail.com (mailing list archive)
Headers show
Series tcp: optimizations for linux-5.17 | expand

Message

Eric Dumazet Nov. 15, 2021, 7:02 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

Mostly small improvements in this series.

The notable change is in "defer skb freeing after
socket lock is released" in recvmsg() (and RX zerocopy)

The idea is to try to let skb freeing to BH handler,
whenever possible, or at least perform the freeing
outside of the socket lock section, for much improved
performance. This idea can probably be extended
to other protocols.

 Tests on a 100Gbit NIC
 Max throughput for one TCP_STREAM flow, over 10 runs.

 MTU : 1500  (1428 bytes of TCP payload per MSS)
 Before: 55 Gbit
 After:  66 Gbit

 MTU : 4096+ (4096 bytes of TCP payload, plus TCP/IPv6 headers)
 Before: 82 Gbit
 After:  95 Gbit

Eric Dumazet (20):
  tcp: minor optimization in tcp_add_backlog()
  tcp: remove dead code in __tcp_v6_send_check()
  tcp: small optimization in tcp_v6_send_check()
  net: use sk_is_tcp() in more places
  net: remove sk_route_forced_caps
  net: remove sk_route_nocaps
  ipv6: shrink struct ipcm6_cookie
  net: shrink struct sock by 8 bytes
  net: forward_alloc_get depends on CONFIG_MPTCP
  net: cache align tcp_memory_allocated, tcp_sockets_allocated
  tcp: small optimization in tcp recvmsg()
  tcp: add RETPOLINE mitigation to sk_backlog_rcv
  tcp: annotate data-races on tp->segs_in and tp->data_segs_in
  tcp: annotate races around tp->urg_data
  tcp: tp->urg_data is unlikely to be set
  tcp: avoid indirect calls to sock_rfree
  tcp: defer skb freeing after socket lock is released
  tcp: check local var (timeo) before socket fields in one test
  tcp: do not call tcp_cleanup_rbuf() if we have a backlog
  net: move early demux fields close to sk_refcnt

 include/linux/skbuff.h     |  2 +
 include/linux/skmsg.h      |  6 ---
 include/net/ip6_checksum.h | 12 ++---
 include/net/ipv6.h         |  4 +-
 include/net/sock.h         | 51 +++++++++++++--------
 include/net/tcp.h          | 18 +++++++-
 net/core/skbuff.c          |  6 +--
 net/core/sock.c            | 18 +++++---
 net/ipv4/tcp.c             | 91 ++++++++++++++++++++++++++------------
 net/ipv4/tcp_input.c       |  8 ++--
 net/ipv4/tcp_ipv4.c        | 10 ++---
 net/ipv4/tcp_output.c      |  2 +-
 net/ipv4/udp.c             |  2 +-
 net/ipv6/ip6_output.c      |  2 +-
 net/ipv6/tcp_ipv6.c        | 10 ++---
 net/mptcp/protocol.c       |  2 +-
 16 files changed, 149 insertions(+), 95 deletions(-)

Comments

Eric Dumazet Nov. 16, 2021, 2:06 a.m. UTC | #1
On Mon, Nov 15, 2021 at 1:47 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Mon, Nov 15, 2021 at 1:40 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >
>
> >
> > Possibly there has been some issues with the ML while processing these
> > patches?!? only an handful of them reached patchwork (and my mailbox :)
> >
>
> Yeah, this sort of thing happens. Let's wait a bit before re-sending ?
>
> Maybe too much traffic today on vger or gmail, I honestly do not know.
>
> I will send the series privately to you in the meantime :)

Apparently the series is now complete on patchwork
https://patchwork.kernel.org/project/netdevbpf/list/?series=580363

Let me know if I need to resend (with few typos fixed)

Thanks.
Arjun Roy Nov. 16, 2021, 4:01 a.m. UTC | #2
On Mon, Nov 15, 2021 at 6:06 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Mon, Nov 15, 2021 at 1:47 PM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Mon, Nov 15, 2021 at 1:40 PM Paolo Abeni <pabeni@redhat.com> wrote:
> > >
> >
> > >
> > > Possibly there has been some issues with the ML while processing these
> > > patches?!? only an handful of them reached patchwork (and my mailbox :)
> > >
> >
> > Yeah, this sort of thing happens. Let's wait a bit before re-sending ?
> >
> > Maybe too much traffic today on vger or gmail, I honestly do not know.
> >
> > I will send the series privately to you in the meantime :)
>
> Apparently the series is now complete on patchwork
> https://patchwork.kernel.org/project/netdevbpf/list/?series=580363
>
> Let me know if I need to resend (with few typos fixed)
>

Deferred SKB free looks good.

Acked-by: Arjun Roy <arjunroy@google.com>

Thanks,
-Arjun

> Thanks.
David Miller Nov. 16, 2021, 1:32 p.m. UTC | #3
From: Eric Dumazet <edumazet@google.com>
Date: Mon, 15 Nov 2021 18:06:29 -0800

> On Mon, Nov 15, 2021 at 1:47 PM Eric Dumazet <edumazet@google.com> wrote:
> 
> Apparently the series is now complete on patchwork
> https://patchwork.kernel.org/project/netdevbpf/list/?series=580363
> 
> Let me know if I need to resend (with few typos fixed)

No need to resend, all applied, thanks Eric!
Eric Dumazet Nov. 16, 2021, 3:06 p.m. UTC | #4
On Tue, Nov 16, 2021 at 5:32 AM David Miller <davem@davemloft.net> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
> Date: Mon, 15 Nov 2021 18:06:29 -0800
>
> > On Mon, Nov 15, 2021 at 1:47 PM Eric Dumazet <edumazet@google.com> wrote:
> >
> > Apparently the series is now complete on patchwork
> > https://patchwork.kernel.org/project/netdevbpf/list/?series=580363
> >
> > Let me know if I need to resend (with few typos fixed)
>
> No need to resend, all applied, thanks Eric!

Thanks David !