[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220903032539.99724-1-kuniyu@amazon.com>
Date: Fri, 2 Sep 2022 20:25:39 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <edumazet@...gle.com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <kuni1840@...il.com>,
<kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH v3 net-next 3/5] tcp: Access &tcp_hashinfo via net.
From: Eric Dumazet <edumazet@...gle.com>
Date: Fri, 2 Sep 2022 20:16:11 -0700
> On Fri, Sep 2, 2022 at 7:50 PM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> > Ah, exactly.
> > Then I will add ____cacheline_aligned_in_smp to tw_refcount, instead of
> > keeping the original order, to avoid invalidation by sysctl_max_tw_buckets
> > change, which wouldn't be so frequently done though.
> >
> > struct inet_timewait_death_row {
> > - refcount_t tw_refcount;
> > -
> > - struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
> > + struct inet_hashinfo *hashinfo;
> > + refcount_t tw_refcount ____cacheline_aligned_in_smp;
> > int sysctl_max_tw_buckets;
>
> This would move sysctl_max_tw_buckets in a separate/dedicated cache line :/
>
> -->
>
> {
> refcount_t tw_refcount;
> /* Padding to avoid false sharing, tw_refcount can be often written */
> struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
> int sysctl_max_tw_buckets;
>
> .. other read only fields could fit here.
>
> > };
>
> Explicit alignment of the structure or first field is not needed,
> they will already be cache line aligned.
I got it. I'll add that change.
Thank you so much!
Powered by blists - more mailing lists