lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJajB9Jp_fJO5jd8_sF1sL6g=NFTw-jgiBRcFT18P0d-w@mail.gmail.com>
Date:   Fri, 2 Sep 2022 20:16:11 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     Kuniyuki Iwashima <kuniyu@...zon.com>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Kuniyuki Iwashima <kuni1840@...il.com>,
        netdev <netdev@...r.kernel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH v3 net-next 3/5] tcp: Access &tcp_hashinfo via net.

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ