Re: [PATCH 6.10 001/123] mm/huge_memory: mark racy access onhuge_anon_orders_always

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/7/24 16:58, Greg Kroah-Hartman wrote:
6.10-stable review patch.  If anyone has any objections, please let me know.
Did the back port [1] I submit just get missed? It fixes a regression I reported [2] with high resolution displays on a dp link after a hub in the amdgpu driver.

[1] https://lore.kernel.org/stable/20240730185339.543359-1-kevin@xxxxxxxx/
[2] https://lore.kernel.org/stable/d74a7768e957e6ce88c27a5bece0c64dff132e24@xxxxxxxx/T/#u

------------------

From: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>

[ Upstream commit 7f83bf14603ef41a44dc907594d749a283e22c37 ]

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>
Stable-dep-of: 00f58104202c ("mm: fix khugepaged activation policy")
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
  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 c73ad77fa33d3..71945cf4c7a8d 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -140,8 +140,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);
  }
static inline int highest_order(unsigned long orders)





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux