[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220310210120.3f068bf2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 10 Mar 2022 21:01:20 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
jeffreyji <jeffreyji@...gle.com>,
Brian Vazquez <brianvv@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH v3 net-next] net: add per-cpu storage and
net->core_stats
On Thu, 10 Mar 2022 08:52:43 -0800 Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Before adding yet another possibly contended atomic_long_t,
> it is time to add per-cpu storage for existing ones:
> dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler
>
> Because many devices do not have to increment such counters,
> allocate the per-cpu storage on demand, so that dev_get_stats()
> does not have to spend considerable time folding zero counters.
>
> Note that some drivers have abused these counters which
> were supposed to be only used by core networking stack.
>
> v3: added a READ_ONCE() in netdev_core_stats_alloc() (Paolo)
>
> v2: add a missing include (reported by kernel test robot <lkp@...el.com>)
> Change in netdev_core_stats_alloc() (Jakub)
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: jeffreyji <jeffreyji@...gle.com>
> Reviewed-by: Brian Vazquez <brianvv@...gle.com>
> Reviewed-by: Jakub Kicinski <kuba@...nel.org>
> Cc: Paolo Abeni <pabeni@...hat.com>
> + for_each_possible_cpu(i) {
> + core_stats = per_cpu(p, i);
IDK if this is just sparse being silly or an actual problem but
apparently the right incantation is:
core_stats = &per_cpu(*p, i);
Powered by blists - more mailing lists