diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index d87a588b51ad..7d553b60cb44 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -128,8 +128,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)