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] [day] [month] [year] [list]
Message-ID: <2339d458-8b98-f540-22f1-50b772eef130@huawei.com>
Date:   Sat, 27 Aug 2022 14:38:54 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Muchun Song <muchun.song@...ux.dev>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        <mike.kravetz@...cle.com>, Muchun Song <songmuchun@...edance.com>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 03/10] hugetlb: Use LIST_HEAD() to define a list head

On 2022/8/27 10:48, Muchun Song wrote:
> 
> 
>> On Aug 27, 2022, at 10:27, Miaohe Lin <linmiaohe@...wei.com> wrote:
>>
>> On 2022/8/27 9:47, Muchun Song wrote:
>>>
>>>
>>>> On Aug 26, 2022, at 17:24, Miaohe Lin <linmiaohe@...wei.com> wrote:
>>>>
>>>> We can avoid unneeded WRITE_ONCE() overhead by using LIST_HEAD() to define
>>>> a list head.
>>>
>>> IIUC, the overhead doesn’t change. Right?
>>
>> I think the overhead is changed. LIST_HEAD is initialized without using WRITE_ONCE():
> 
> I think there is no special difference with "WRITE_ONCE(var, 0)" vs "var = 0” in

It's not write var to 0 indeed. But there seems are no special difference.

> assembly code. Both code of line will be compiled to a mov or movq instruction.
> I didn’t confirm if the assembly code is different (I tend to think it is similar).
> Just some analysis from me.

I checked the generated code in x86, they're almost same. And in aarch64, there's difference
between one "stp" instruction vs two "str" instruction. So I think you're right. Thanks for
pointing this out. I should tweak the commit log in next version.

Thanks a lot,
Miaohe Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ