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] [day] [month] [year] [list]
Date:   Thu, 16 Jun 2022 11:21:55 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     Joao Martins <joao.m.martins@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        Dan Williams <dan.j.williams@...el.com>
Subject: Re: [PATCH] mm/page_alloc: make calling prep_compound_head more
 reliable

On 2022/6/15 20:42, Matthew Wilcox wrote:
> On Wed, Jun 15, 2022 at 03:44:06PM +0800, Miaohe Lin wrote:
>>> We definitely don't need the unlikely here.
>>
>> Could you please give me a more detailed explanation? IIUC, the above if condition
>> will only meet at a probability of 1/512. So unlikely tells the compiler to do some
>> optimization around it. Or am I miss something?
> 
> Only add unlikely() when the compiler can't figure out for itself that
> it's unlikely.  You should also check the generated code and/or
> benchmark the results to be sure that it's actually an improvement.
> Using unlikely() needs to be backed up with more than just a feeling.

I see. Many thanks for clarifying. Will keep it in mind. :)

> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ