Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp934654lqo; Fri, 10 May 2024 23:44:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiMLGYLY0w/GIqWVyu/Hl4j0s7l/P6QttRwKUogHu3m1vR17EseeswhXUpbLGjA4iknPVB3eEpv+WGhuv+cCOgYJ9PWP3O9zFLg4C9iA== X-Google-Smtp-Source: AGHT+IEO5XDLGopQKJsonymUXVlFw6nj5ryybKf7gASQFJiy+QE0EdEyP8Ui7BV/7OwfgqPQRBVs X-Received: by 2002:a05:620a:204c:b0:792:9248:c2e9 with SMTP id af79cd13be357-792c75f4506mr531630585a.48.1715409895238; Fri, 10 May 2024 23:44:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715409895; cv=pass; d=google.com; s=arc-20160816; b=wIzh4aL6xmaYXGeUElspBxIaz3v7ZPoK77BQ/1Ph7Qc5vdM4XNu0og9sT9wrjmHDi1 zTme+P0GhLxaAF7yvtXLkPTnEdUt7Jyjs0OvDUKg6bF0y/srjhFVJbpVZYKfIvdvhJUz 6EsFvET1CYFAF+EnluKgF1YejAp6UNU5tRVHWnOi7mgMmCqRCyfBzUVBd3mNxHdLwWNn DYZ+L0gI1vvGf1tZlxhuOrB3H8hRGBXMV/3MNZUfd00al86DY+iKYvXGQkoeQEMD7HWJ XxJA+v/tVaVBjcknVFDEiCkpqBC5/ci4bN2IUyWO0HjP5mTnBKewc4YY41CdbKVppVtO fJbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date; bh=6bdr0N9TaM4YPIOdxhc5FdKzzdCLL+HFnHl4C6/zK0M=; fh=jRt5UQrZQBywzpxIoAJcShye9oM09yTvBRsCz7m7ias=; b=IJNglyHSYzNen/atfEu1nq/l7yiPesJfgRfgioyoOch1+598NH/KAXrtT35pbNAvRB RNOtdfsu98bwy3ulwFg2qD2MzkF1KgVC/ggl+kzfo4vTolnj2fsTiCdJ2CYO8EIrmNyg 8F3XRAicde6nxKnizb2FRzXXU69MEOAt0dKRhszfXjv5QaBTskm6fCIZdbt5/FIYbzW/ 8wkguzMBKUOqKPTeGu8P2/Mm63U4PzHRWYC/nLHv/B4UkZkNH/tnnlliNlphwWhOsc+G Xnt7osv8d7yecUwCzBJYs6emHJw6XbXdhxI/gAwe3GTdBQuFh/EQ0GaQtfEIWjRVWFIW iNWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-176438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792d196856bsi56012485a.752.2024.05.10.23.44.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 23:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-176438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F06421C210CA for ; Sat, 11 May 2024 06:44:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC4F01C01; Sat, 11 May 2024 06:44:48 +0000 (UTC) Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 351F1EC2 for ; Sat, 11 May 2024 06:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.40 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715409888; cv=none; b=MEqZTs7nXAeDvzv3um7EcNfhojlxydTNre3u7mHV8eJw9+BTnv6eaLpteuMvpdvB2hqevEHenZdeRC7Wv36uaNOBx0SVGi3GM10nBxJXXRM3aUA0Pfk3mGwOooVI9AmPUaAhsG/33+cPMeN0yACTK08ej4OJcLH5OAa/dGQ09UI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715409888; c=relaxed/simple; bh=WsNHsd+jz9I274qS7nFlFQWVmYolB0GcoLoyQbUvVMo=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=ueDMxoqDPDVVkcbZ+mEUawr5hcY99X9Dn3UNxJqUh8Uc2cgatOW7Me4kRUnSkiXQqUImBhfwd2MEiz/1L0IgM7s/nDhO77814rhjJ5C3I1cTVACfZh1A1MQo6mHijCzTU8pVnhb/90wuRz7QCUtp9JUof5r5BZJF4ms1f2qqh+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=63.216.63.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4Vbx7X5tphz8XrXG; Sat, 11 May 2024 14:44:40 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 44B6iY3k075463; Sat, 11 May 2024 14:44:34 +0800 (+08) (envelope-from xu.xin16@zte.com.cn) Received: from mapi (xaxapp03[null]) by mapi (Zmail) with MAPI id mid32; Sat, 11 May 2024 14:44:36 +0800 (CST) Date: Sat, 11 May 2024 14:44:36 +0800 (CST) X-Zmail-TransId: 2afb663f13d40bb-06f01 X-Mailer: Zmail v1.0 Message-ID: <20240511144436754EiKfJM4xjMSTyCbEExwcL@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?wqBbUEFUQ0ggbGludXgtbmV4dF0gbW0vaHVnZV9tZW1vcnk6IG1hcmsgcmFjeSBhY2Nlc3Mgb27CoGh1Z2VfYW5vbl9vcmRlcnNfYWx3YXlz?= Content-Type: text/plain; charset="UTF-8" X-MAIL:mse-fl2.zte.com.cn 44B6iY3k075463 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 663F13D8.001/4Vbx7X5tphz8XrXG From: Ran Xiaokai huge_anon_orders_always and huge_anon_orders_always are 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. Signed-off-by: Ran Xiaokai --- 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); } static inline int highest_order(unsigned long orders) -- 2.15.2