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]
Date:   Sat, 27 Aug 2022 10:27:46 +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 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():

#define LIST_HEAD_INIT(name) { &(name), &(name) }

#define LIST_HEAD(name) \
	struct list_head name = LIST_HEAD_INIT(name)

while INIT_LIST_HEAD has:

static inline void INIT_LIST_HEAD(struct list_head *list)
{
	WRITE_ONCE(list->next, list);
	WRITE_ONCE(list->prev, list);
}

Or am I miss something?

> 
> I’m fine with your changes.
> 
> Reviewed-by: Muchun Song <songmuchun@...edance.com>

Many thanks for your review and comment. :)

Thanks,
Miaohe Lin

Powered by blists - more mailing lists