Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2246323lqo; Mon, 13 May 2024 12:05:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoK5CeJ7f0pIrGJYKS5gJWYXSxIw3bxu2YFVRICWa+hxqZCLCJ8i3P1YFcrfHYGOqzKyB1Sv6izKuYMkf5bZrJoTA8bO64gYXTu0EEJg== X-Google-Smtp-Source: AGHT+IGUZ6RvH3DhXQTh3n0WtA8LevM6RgqZM0vOjjQ375M2PU044pI54RoQvG9uFasMk8cfSqWu X-Received: by 2002:a05:6a20:7f96:b0:1af:593a:c820 with SMTP id adf61e73a8af0-1afd14919a1mr17649554637.31.1715627150577; Mon, 13 May 2024 12:05:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715627150; cv=pass; d=google.com; s=arc-20160816; b=UhKsPwzTAzRL3wQui8L+16a+kH4e6NRgPsTKvyF1R4+wbl43FVKdJE9cFBKlVAakD3 0HbA14QPUJPWPtWCp/eTzsvcjcKbZtanZZy1e+3kESt3PuNjiEdmmAQTsnyRuff6TyYN ROuU6jD4hWRX+0U2dtD4aVfjS97xEzYsH1gLz52g94MNuAChbwyBh2YMWCZq01g7xWMu nzq22Ytf2M1/szzAGHC2jy/lBa574rKskf6d4rEObXzVzUJtKRWF8EPGbwDGjgg4Kq/Q WdgCBEJuKgWkh68RCqd77NEJRKlBU/gI/EPKvIjnhpCeT+bujZb6hlvWXWErYQVEauqX uxdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=CHVX7QXs7ZSa+q8I5S8KqDQd8wCAFFUEKhPAoKqf6Lk=; fh=kt30sPORhHeMk2Ydox6j7LcCj9yqswdsL9DEreX0mmY=; b=SVagiiEL5tZLvxlrJ8yqipBCEP5w2QqeJOaYv2h4vlRISx2UxBLTlK17EwQh1uooPf oOuyULixfxky6NxeMaik3J2ouwBdg1ZkYFSVLcqBWe3EtdwmsRPiMXcCnyS6VMV57kM3 jPOvU2QA8DVq/OLjeuyv54D3GMPGHc+Mi4aXTbUg6NdhJE5f6YrZmhwvJ0SHT3QdSMHC JVsZOee8EPEpyhGGsH0AMgzYAToR+r8fMcn0RIC8MhcXO3MDjx8MocBWxDTmFOlZ0/+J X81QHfxS5bc+Jrk1RGFk6rLWJPYSWN90I6Dxcd2gzK1TxGM+3wH/8fMTUGP0yNfp+ATy lK1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NApWZgbi; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-178007-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341404f995si9599871a12.884.2024.05.13.12.05.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 12:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178007-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NApWZgbi; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-178007-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F32E0285898 for ; Mon, 13 May 2024 19:05:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 481264500E; Mon, 13 May 2024 19:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NApWZgbi" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98B7446AE for ; Mon, 13 May 2024 19:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715627143; cv=none; b=PqJ3bZLM0tQyOysmE/gkemSO/o5WsSdcE0/qOd8uiKOm+Rt0f92uRezQ4SeQAmkWwQ6eV5kP/U5pTa9oFxj6pOeTnQm0SEmItdIKwgM6UJgZTjhWyLJoNkDRlJLKrI854VLgk+OaFsRvvp+urAWLVa4atMQT6O5wnUKt4fuyvls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715627143; c=relaxed/simple; bh=RCInyTf7dR85Mi3yye7ngyof3uXWDGHs5UvX/c5fJTs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BEBZSbHyawBJ+IYG3ycU5/JAPV2iIj54zPeZzg8Fx31BtHsoRjIOgxlUTQc7kVR1QnRxJPh18M5jVFrg4u5D9475OQvbFbGbbLK/xU5/QZrztq5Jy8QCHCwicHNIpnESQPUcMxqs4VtbjDJLsN2BGHfJtpNI0Fc5+I+GoeU2chA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NApWZgbi; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a59a64db066so1199065066b.3 for ; Mon, 13 May 2024 12:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715627140; x=1716231940; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CHVX7QXs7ZSa+q8I5S8KqDQd8wCAFFUEKhPAoKqf6Lk=; b=NApWZgbi76AUB6Xriz5z9ICBmOqPT4l+ZFDfLiw2qKNkNuzjTy1VPyw2lOALErRlff VEQ2P7qGjpVaGpxeYOkMT7gkry8zmtwqlyngoyvYi+6Cyu1ZssNIWRcxS3G6YCk56xaK edHy2CKA77fgis4FgHfmoDn3YRrNxq1ticc+rqpGdE0Q4MuUc/XfqgcmzJl8D1klep9s msNst9Ef5jWGqZRaUBJATwVlO0rEZ6ae17bC/6qfZSl50qcEoPuxYg7LA67ypUu2ZrR3 VIYTOGIYnXrSi/fS1qdkDoQZHvrMl8d3ahv8vAUVGUZuL2a/v5gPqWXvpLafErB+iRVn /o1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715627140; x=1716231940; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CHVX7QXs7ZSa+q8I5S8KqDQd8wCAFFUEKhPAoKqf6Lk=; b=JyH1FZ7BaxEXEC8rFYgFkVtknYJFeYEnTyM/DRt1OJOsDJLy6cw9M4NgDt4o2jeHlj 94KFmHohCddEDZC1I3RvZgpV6wxR1qHllrUEtnGDTLIkvaCap1arrv2LtLn4gOXGuONV MUmtkklZMfCQGuQjyv1WsTRbAKGDvVDW5KbA0i1qiCj03qSc0vykQ+vPI55G5vrqUv8C /XUzY/Utt+jyt2eAg/4BPEG8JS3t1Yze9iq8CdEyDE0NXaNHMMw7E0bhaNUef2UH4XXj 6Idak0mwglNNai/KHUzaJnuod83w0ZU4OTGAWaeLayHH7qCjjlP3F5v4H9WPBUwa50Nn xhow== X-Forwarded-Encrypted: i=1; AJvYcCXbS/t3hhNUeex8cXi+SZZBmBY0nYnmHd0fo1JvaUUrcNBKb5SIDZHWThdxoaF9XmI+0FzZvRFqTsBHIy8xsNd4xPoHbWtIvfzCx7Nt X-Gm-Message-State: AOJu0YxAW2an5s2gOmHqOigsLiDTxevchHFoZmzzINBQi/eC9vkx6SB8 EX8qRCAa4u3vS49iv02pJjekaBrwQDs9+fJLdLGhKdfb3z0WWXQeQubzTrWwpw+ciIhEyTAPclW yQtpqU8YJzr9E0Vv1P0EVYgXYHkc= X-Received: by 2002:a17:907:3f9f:b0:a59:cd46:fe89 with SMTP id a640c23a62f3a-a5a2d665690mr830382166b.59.1715627140010; Mon, 13 May 2024 12:05:40 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240511144436754EiKfJM4xjMSTyCbEExwcL@zte.com.cn> In-Reply-To: <20240511144436754EiKfJM4xjMSTyCbEExwcL@zte.com.cn> From: Yang Shi Date: Mon, 13 May 2024 13:05:28 -0600 Message-ID: Subject: Re: [PATCH linux-next] mm/huge_memory: mark racy access on huge_anon_orders_always To: xu.xin16@zte.com.cn Cc: akpm@linux-foundation.org, david@redhat.com, willy@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ziy@nvidia.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 11, 2024 at 12:44=E2=80=AFAM wrote: > > 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. A little bit confused here. Did you see complaints from KCSAN? > 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