[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKM6yMP2Doy0MuCrfX1LASPFt_OnpPY-aNg+hu=F3W7AA@mail.gmail.com>
Date: Tue, 28 Feb 2023 16:17:34 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...uxfoundation.org>, x86@...nel.org,
Wangyang Guo <wangyang.guo@...el.com>,
Arjan van De Ven <arjan@...ux.intel.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Mark Rutland <mark.rutland@....com>,
Marc Zyngier <maz@...nel.org>
Subject: Re: [patch 1/3] net: dst: Prevent false sharing vs. dst_entry::__refcnt
On Tue, Feb 28, 2023 at 3:33 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> From: Wangyang Guo <wangyang.guo@...el.com>
>
> dst_entry::__refcnt is highly contended in scenarios where many connections
> happen from and to the same IP. The reference count is an atomic_t, so the
> reference count operations have to take the cache-line exclusive.
>
> Aside of the unavoidable reference count contention there is another
> significant problem which is caused by that: False sharing.
>
> perf top identified two affected read accesses. dst_entry::lwtstate and
> rtable::rt_genid.
>
> dst_entry:__refcnt is located at offset 64 of dst_entry, which puts it into
> a seperate cacheline vs. the read mostly members located at the beginning
> of the struct.
This will probably increase struct rt6_info past the 4 cache line size, right ?
It would be nice to allow sharing the 'hot' cache line with seldom used fields.
Instead of mere pads, add some unions, and let rt6i_uncached/rt6i_uncached_list
use them.
Powered by blists - more mailing lists