[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240514084403.661740-1-ranxiaokai627@163.com>
Date: Tue, 14 May 2024 08:44:03 +0000
From: ran xiaokai <ranxiaokai627@....com>
To: david@...hat.com
Cc: ran.xiaokai@....com.cn,
akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
shy828301@...il.com,
willy@...radead.org,
xu.xin16@....com.cn,
ziy@...dia.com
Subject: Re: [PATCH linux-next] mm/huge_memory: mark racy access on huge_anon_orders_always
Hi, David
Thanks for taking time to review!
>> From: Ran Xiaokai <ran.xiaokai@....com.cn>
>>
>> huge_anon_orders_always and huge_anon_orders_always are accessed
>
> "huge_anon_orders_always" mentioned twice.
yes, my mistake.
>> lockless, it is better to use the READ_ONCE() wrapper.
>> This is not fixing any visible bug, hopefully this can cease some
>> KCSAN complains in the future.
>> Also do that for huge_anon_orders_madvise.
>>
>> Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
>> ---
>> include/linux/huge_mm.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
>> index de0c89105076..6573430ea600 100644
>> --- a/include/linux/huge_mm.h
>> +++ b/include/linux/huge_mm.h
>> @@ -122,8 +122,8 @@ static inline bool hugepage_flags_enabled(void)
>> * So we don't need to look at huge_anon_orders_inherit.
>> */
>> return hugepage_global_enabled() ||
>> - huge_anon_orders_always ||
>> - huge_anon_orders_madvise;
>> + READ_ONCE(huge_anon_orders_always) ||
>> + READ_ONCE(huge_anon_orders_madvise);
>
> Don't mess up the alignment please.
yes.
I will wait for other feedbacks and then send out a v2 version.
>> }
>>
>> static inline int highest_order(unsigned long orders)
>
> Acked-by: David Hildenbrand <david@...hat.com>
Powered by blists - more mailing lists