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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Mar 2020 11:45:48 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     Kuniyuki Iwashima <kuniyu@...zon.co.jp>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Gerrit Renker <gerrit@....abdn.ac.uk>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        dccp@...r.kernel.org, netdev <netdev@...r.kernel.org>,
        Kuniyuki Iwashima <kuni1840@...il.com>,
        osa-contribution-log@...zon.com
Subject: Re: [PATCH net-next 1/2] tcp/dccp: Move initialisation of refcounted
 into if block.

On Mon, Mar 23, 2020 at 11:18 AM Kuniyuki Iwashima <kuniyu@...zon.co.jp> wrote:
>
> The refcounted is initialised at most three times.
>
>   - __inet_lookup_skb() sets it true.
>   - skb_steal_sock() is false and __inet_lookup() sets it true.
>   - __inet_lookup_established() is false and __inet_lookup() sets it false.
>
> We do not need to initialise refcounted again and again, so we should do
> it just before return.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
> ---

Well, I do not believe this patch (and the following one) makes things
more readable.

I doubt setting a boolean in a register or a stack variable has any cost,
I prefer letting the compiler optimize this.

The ehash lookup cost is at least 2 or 3 cache lines, this is the
major contribution.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ