mbox series

[net-next,0/4] udp: small changes on receive path

Message ID 20240328144032.1864988-1-edumazet@google.com (mailing list archive)
Headers show
Series udp: small changes on receive path | expand

Message

Eric Dumazet March 28, 2024, 2:40 p.m. UTC
This series is based on an observation I made in UDP receive path.

The sock_def_readable() costs are pretty high, especially when
epoll is used to generate EPOLLIN events.

First patch annotates races on sk->sk_rcvbuf reads.

Second patch replaces an atomic_add_return()
 with a less expensive atomic_add()

Third patch avoids calling sock_def_readable() when possible.

Fourth patch adds sk_wake_async_rcu() to get better inlining
and code generation.

Eric Dumazet (4):
  udp: annotate data-race in __udp_enqueue_schedule_skb()
  udp: relax atomic operation on sk->sk_rmem_alloc
  udp: avoid calling sock_def_readable() if possible
  net: add sk_wake_async_rcu() helper

 crypto/af_alg.c      |  4 ++--
 include/net/sock.h   |  6 ++++++
 net/atm/common.c     |  2 +-
 net/core/sock.c      |  8 ++++----
 net/dccp/output.c    |  2 +-
 net/ipv4/udp.c       | 32 ++++++++++++++++++--------------
 net/iucv/af_iucv.c   |  2 +-
 net/rxrpc/af_rxrpc.c |  2 +-
 net/sctp/socket.c    |  2 +-
 net/smc/smc_rx.c     |  4 ++--
 net/unix/af_unix.c   |  2 +-
 11 files changed, 38 insertions(+), 28 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 29, 2024, 10:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 28 Mar 2024 14:40:28 +0000 you wrote:
> This series is based on an observation I made in UDP receive path.
> 
> The sock_def_readable() costs are pretty high, especially when
> epoll is used to generate EPOLLIN events.
> 
> First patch annotates races on sk->sk_rcvbuf reads.
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] udp: annotate data-race in __udp_enqueue_schedule_skb()
    https://git.kernel.org/netdev/net-next/c/605579699513
  - [net-next,2/4] udp: relax atomic operation on sk->sk_rmem_alloc
    https://git.kernel.org/netdev/net-next/c/6a1f12dd85a8
  - [net-next,3/4] udp: avoid calling sock_def_readable() if possible
    https://git.kernel.org/netdev/net-next/c/612b1c0dec5b
  - [net-next,4/4] net: add sk_wake_async_rcu() helper
    https://git.kernel.org/netdev/net-next/c/1abe267f173e

You are awesome, thank you!