All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	 Willem de Bruijn <willemb@google.com>,
	 Kuniyuki Iwashima <kuniyu@google.com>,
	 David Ahern <dsahern@kernel.org>,
	 netdev@vger.kernel.org,  eric.dumazet@gmail.com,
	 Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net-next 07/10] net: group sk_backlog and sk_receive_queue
Date: Wed, 17 Sep 2025 11:01:44 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.a51d1cd6f43c@gmail.com> (raw)
In-Reply-To: <20250916160951.541279-8-edumazet@google.com>

Eric Dumazet wrote:
> UDP receivers suffer from sk_rmem_alloc updates,
> currently sharing a cache line with fields that
> need to be read-mostly (sock_read_rx group):
> 
> 1) RFS enabled hosts read sk_napi_id
> from __udpv6_queue_rcv_skb().
> 
> 2) sk->sk_rcvbuf is read from __udp_enqueue_schedule_skb()
> 
> /* --- cacheline 3 boundary (192 bytes) --- */
> struct {
>     atomic_t           rmem_alloc;           /*  0xc0   0x4 */   // Oops
>     int                len;                  /*  0xc4   0x4 */
>     struct sk_buff *   head;                 /*  0xc8   0x8 */
>     struct sk_buff *   tail;                 /*  0xd0   0x8 */
> } sk_backlog;                                /*  0xc0  0x18 */
> __u8                       __cacheline_group_end__sock_write_rx[0]; /*  0xd8     0 */
> __u8                       __cacheline_group_begin__sock_read_rx[0]; /*  0xd8     0 */
> struct dst_entry *         sk_rx_dst;        /*  0xd8   0x8 */
> int                        sk_rx_dst_ifindex;/*  0xe0   0x4 */
> u32                        sk_rx_dst_cookie; /*  0xe4   0x4 */
> unsigned int               sk_ll_usec;       /*  0xe8   0x4 */
> unsigned int               sk_napi_id;       /*  0xec   0x4 */
> u16                        sk_busy_poll_budget;/*  0xf0   0x2 */
> u8                         sk_prefer_busy_poll;/*  0xf2   0x1 */
> u8                         sk_userlocks;     /*  0xf3   0x1 */
> int                        sk_rcvbuf;        /*  0xf4   0x4 */
> struct sk_filter *         sk_filter;        /*  0xf8   0x8 */
> 
> Move sk_error (which is less often dirtied) there.
> 
> Alternative would be to cache align sock_read_rx but
> this has more implications/risks.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

  reply	other threads:[~2025-09-17 15:01 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 16:09 [PATCH net-next 00/10] udp: increase RX performance under stress Eric Dumazet
2025-09-16 16:09 ` [PATCH net-next 01/10] ipv6: make ipv6_pinfo.saddr_cache a boolean Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:30   ` David Ahern
2025-09-17 17:56   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 02/10] ipv6: make ipv6_pinfo.daddr_cache " Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:33   ` David Ahern
2025-09-17 17:57   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 03/10] ipv6: np->rxpmtu race annotation Eric Dumazet
2025-09-17 14:59   ` Willem de Bruijn
2025-09-17 15:34   ` David Ahern
2025-09-17 17:59   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 04/10] ipv6: reorganise struct ipv6_pinfo Eric Dumazet
2025-09-17 15:00   ` Willem de Bruijn
2025-09-17 15:36   ` David Ahern
2025-09-17 18:01   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 05/10] udp: refine __udp_enqueue_schedule_skb() test Eric Dumazet
2025-09-17 15:00   ` Willem de Bruijn
2025-09-17 15:57     ` Eric Dumazet
2025-09-17 17:53       ` Kuniyuki Iwashima
2025-09-17 19:07         ` Willem de Bruijn
2025-09-17 15:39   ` David Ahern
2025-09-16 16:09 ` [PATCH net-next 06/10] udp: update sk_rmem_alloc before busylock acquisition Eric Dumazet
2025-09-17 15:01   ` Willem de Bruijn
2025-09-17 16:07     ` Eric Dumazet
2025-09-17 19:14       ` Willem de Bruijn
2025-09-17 15:44   ` David Ahern
2025-09-17 18:02   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 07/10] net: group sk_backlog and sk_receive_queue Eric Dumazet
2025-09-17 15:01   ` Willem de Bruijn [this message]
2025-09-17 15:45   ` David Ahern
2025-09-17 18:11   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 08/10] udp: add udp_drops_inc() helper Eric Dumazet
2025-09-17 15:02   ` Willem de Bruijn
2025-09-17 15:47   ` David Ahern
2025-09-17 18:13   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 09/10] udp: make busylock per socket Eric Dumazet
2025-09-16 16:31   ` Willem de Bruijn
2025-09-16 17:10     ` Eric Dumazet
2025-09-16 19:15       ` Willem de Bruijn
2025-09-17 15:03   ` Willem de Bruijn
2025-09-17 15:52   ` David Ahern
2025-09-17 18:15   ` Kuniyuki Iwashima
2025-09-16 16:09 ` [PATCH net-next 10/10] udp: use skb_attempt_defer_free() Eric Dumazet
2025-09-17 15:03   ` Willem de Bruijn
2025-09-17 15:55   ` David Ahern
2025-09-17 16:15   ` Paolo Abeni
2025-09-17 16:32     ` Eric Dumazet
2025-09-18  6:38       ` Paolo Abeni
2025-09-17 18:20   ` Kuniyuki Iwashima
2025-10-13 21:44   ` [REGRESSION] xfrm issue bisected to 6471658dc66c ("udp: use skb_attempt_defer_free()") Michal Kubecek
2025-10-13 22:12     ` Eric Dumazet
2025-09-18  1:03 ` [PATCH net-next 00/10] udp: increase RX performance under stress Jakub Kicinski
2025-09-18  8:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=willemdebruijn.kernel.a51d1cd6f43c@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.