[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAVpQUDiGuCtUzXeJw0004VxDHFketF7J+Xu6tqEod_o=3r7Kg@mail.gmail.com>
Date: Sat, 27 Sep 2025 13:28:20 -0700
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Willem de Bruijn <willemb@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 3/3] net: add NUMA awareness to skb_attempt_defer_free()
On Fri, Sep 26, 2025 at 8:13 AM Eric Dumazet <edumazet@...gle.com> wrote:
>
> Instead of sharing sd->defer_list & sd->defer_count with
> many cpus, add one pair for each NUMA node.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> include/linux/netdevice.h | 4 ----
> include/net/hotdata.h | 7 +++++++
> net/core/dev.c | 37 +++++++++++++++++++++++++------------
> net/core/dev.h | 2 +-
> net/core/skbuff.c | 11 ++++++-----
> 5 files changed, 39 insertions(+), 22 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 5c9aa16933d197f70746d64e5f44cae052d9971c..d1a687444b275d45d105e336d2ede264fd310f1b 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -3536,10 +3536,6 @@ struct softnet_data {
>
> struct numa_drop_counters drop_counters;
>
> - /* Another possibly contended cache line */
> - struct llist_head defer_list ____cacheline_aligned_in_smp;
> - atomic_long_t defer_count;
> -
> int defer_ipi_scheduled ____cacheline_aligned_in_smp;
> call_single_data_t defer_csd;
> };
> diff --git a/include/net/hotdata.h b/include/net/hotdata.h
> index fda94b2647ffa242c256c95ae929d9ef25e54f96..4acec191c54ab367ca12fff590d1f8c8aad64651 100644
> --- a/include/net/hotdata.h
> +++ b/include/net/hotdata.h
> @@ -2,10 +2,16 @@
> #ifndef _NET_HOTDATA_H
> #define _NET_HOTDATA_H
>
> +#include <linux/llist.h>
> #include <linux/types.h>
> #include <linux/netdevice.h>
> #include <net/protocol.h>
>
> +struct skb_defer_node {
> + struct llist_head defer_list;
> + atomic_long_t defer_count;
> +} ____cacheline_aligned_in_smp;
> +
> /* Read mostly data used in network fast paths. */
> struct net_hotdata {
> #if IS_ENABLED(CONFIG_INET)
> @@ -30,6 +36,7 @@ struct net_hotdata {
> struct rps_sock_flow_table __rcu *rps_sock_flow_table;
> u32 rps_cpu_mask;
> #endif
> + struct skb_defer_node __percpu *skb_defer_nodes;
> int gro_normal_batch;
> int netdev_budget;
> int netdev_budget_usecs;
> diff --git a/net/core/dev.c b/net/core/dev.c
> index fb67372774de10b0b112ca71c7c7a13819c2325b..afcf07352eaa3b9a563173106c84167ebe1ab387 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5180,8 +5180,9 @@ static void napi_schedule_rps(struct softnet_data *sd)
> __napi_schedule_irqoff(&mysd->backlog);
> }
>
> -void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu)
> +void kick_defer_list_purge(unsigned int cpu)
> {
> + struct softnet_data *sd = &per_cpu(softnet_data, cpu);
> unsigned long flags;
>
> if (use_backlog_threads()) {
> @@ -6715,18 +6716,26 @@ bool napi_complete_done(struct napi_struct *n, int work_done)
> }
> EXPORT_SYMBOL(napi_complete_done);
>
> -static void skb_defer_free_flush(struct softnet_data *sd)
> +struct skb_defer_node __percpu *skb_defer_nodes;
seems this is unused, given it's close to the end of cycle
maybe this can be fixed up while applying ? :)
Reviewed-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Thanks!
Powered by blists - more mailing lists