The patch titled Subject: mm/huge_memory: mark racy access onhuge_anon_orders_always has been added to the -mm mm-unstable branch. Its filename is mm-huge_memory-mark-racy-access-onhuge_anon_orders_always.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-huge_memory-mark-racy-access-onhuge_anon_orders_always.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx> Subject: mm/huge_memory: mark racy access onhuge_anon_orders_always Date: Wed, 15 May 2024 10:47:54 +0800 (CST) huge_anon_orders_always is accessed 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. Link: https://lkml.kernel.org/r/20240515104754889HqrahFPePOIE1UlANHVAh@xxxxxxxxxx Signed-off-by: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Reviewed-by: Lu Zhongjun <lu.zhongjun@xxxxxxxxxx> Reviewed-by: xu xin <xu.xin16@xxxxxxxxxx> Cc: Yang Yang <yang.yang29@xxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Yang Shi <shy828301@xxxxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/huge_mm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/huge_mm.h~mm-huge_memory-mark-racy-access-onhuge_anon_orders_always +++ a/include/linux/huge_mm.h @@ -134,8 +134,8 @@ static inline bool hugepage_flags_enable * 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); } static inline int highest_order(unsigned long orders) _ Patches currently in -mm which might be from ran.xiaokai@xxxxxxxxxx are mm-huge_memory-mark-racy-access-onhuge_anon_orders_always.patch