From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1AF2A283FF9 for ; Wed, 18 Feb 2026 19:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771443286; cv=none; b=ljgbHOiJGoncIKASu/q3ITR2SM+cFuTL4O6hS2PQRIg67RwTMW6gME0EEN+JFoxq8fO96iIf4B78ouGyVe8MhYL4WL21qL+mL7Tt78YsXbfTcvyeyyVH4+3Ty1B5eadxiKcX2flw2U7y5hJ159WSWV6CgOmMx7N8xxxSAWSz2rA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771443286; c=relaxed/simple; bh=IG31AiFfOJUmSLuowWqXZKSA/8W07j+Lq5NnL99uB8A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nxo+tJJ/ZpuiVAv9b9INuws7CiEQygOY3/CVgdCAwV4sTUASsFeQvk4J8VZFhixj7JfpCzznWjJks8gad9DlUIs9NemCClFlP76qjVVTMokfg+NBTF+yBFmpxmXbdCOZlT69NY7n4JOLgnmv7reQamZh/xi4gfw5/U0enNXmPP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k3wB8jak; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k3wB8jak" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4763EC4AF09; Wed, 18 Feb 2026 19:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771443285; bh=IG31AiFfOJUmSLuowWqXZKSA/8W07j+Lq5NnL99uB8A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k3wB8jakDp5DiVmQkjGXo0Nnv9+iOP8Ezl6zVO1YlgHf+dkpoe+eh05IG7Sg6K7BD eYzHL0RlSeJSaUcuV4sSobLmNvVV6dbJG+veM24zx+uE8l3uA90pcDqhbEbJ/hg9Op FEDQM5nZscXCWtmv/omU4czfrTHxfYUDQf9uoJlW07ayc2+KQQmh6eGpd/H6sWhGjd gbAyR+ocy27y3sCng+dQQrkyCOG9+uhIP8ENwfaKFw4yn8GpjLC3iSzQfe9DAK1+hq c9ogGDHhEhBY1e9ogTNOdJpDXJMlRjrEkZOialWZcejXxnGNWsZc8oGMszcs+m/NmS 98ckGSDWUnw0Q== Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfauth.phl.internal (Postfix) with ESMTP id 3A2FDF4006C; Wed, 18 Feb 2026 14:34:44 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 18 Feb 2026 14:34:44 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvvdefgeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtrodttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrhhnpe efhefgffelkefhheeifeeggefhgeeuieevueegfeeugfeuffeludeuhefhleeggeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduieejtdelkeegjeduqddujeej keehheehvddqsghoqhhunheppehkvghrnhgvlhdrohhrghesfhhigihmvgdrnhgrmhgvpd hnsggprhgtphhtthhopedvtddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthho rhhvrghlughssehlihhnuhigqdhfohhunhgurghtihhonhdrohhrghdprhgtphhtthhope gurghvihgurdhlrghighhhthdrlhhinhhugiesghhmrghilhdrtghomhdprhgtphhtthho pegvlhhvvghrsehgohhoghhlvgdrtghomhdprhgtphhtthhopeifihhllheskhgvrhhnvg hlrdhorhhgpdhrtghpthhtohepphgvthgvrhiisehinhhfrhgruggvrggurdhorhhgpdhr tghpthhtohepmhhinhhgoheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhglhigse hlihhnuhhtrhhonhhigidruggvpdhrtghpthhtohepsghoqhhunhdrfhgvnhhgsehgmhgr ihhlrdgtohhmpdhrtghpthhtoheplhhonhhgmhgrnhesrhgvughhrghtrdgtohhm X-ME-Proxy: Feedback-ID: i8dbe485b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Feb 2026 14:34:43 -0500 (EST) Date: Wed, 18 Feb 2026 11:34:42 -0800 From: Boqun Feng To: Linus Torvalds Cc: David Laight , Marco Elver , Will Deacon , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Boqun Feng , Waiman Long , Bart Van Assche , llvm@lists.linux.dev, Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel test robot , Al Viro , Alice Ryhl , Gary Guo Subject: Re: [PATCH v3 3/3] arm64, compiler-context-analysis: Permit alias analysis through __READ_ONCE() with CONFIG_LTO=y Message-ID: References: <20260206182650.6c21b0ff@pumpkin> <20260215221656.68b2fc1d@pumpkin> <20260216110915.4f0d5490@pumpkin> <20260216174324.75d47e37@pumpkin> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Feb 17, 2026 at 08:32:32AM -0800, Linus Torvalds wrote: > On Tue, 17 Feb 2026 at 08:23, Linus Torvalds > wrote: > > > > But last time I looked at it - which was admittedly a few years ago - > > the compilers we supported didn't actually do anything reasonable here > > (ie the built-in atomics were fundamentally worse than the ones we do > > by hand, and even basic things like __atomic_load_n() weren't > > actually; better than just using 'volatile'. > > > > Maybe that has changed. We've upgraded minimum compilers since. > > I just checked a few test-cases, and I don't think anything has changed. > > All the trivial things where __atomic_load_n(__ATOMIC_RELAXED) *could* > do better than just our old code using "cast pointer to volatile" > resulted in no better code generation. > By any chance, could you share the test cases? It'll be really helpful to represent what semantics we really want to compiler/language folks. [Cc Alice and Gary] Regards, Boqun > So we're sticking to that "cast to volatile" not because it's great, > but because it continues to be reliable and no worse than the fancy > modern versions. > > But at least it's explicit in the code, not hidden away in code that > *looks* like it just dereferences another field in a structure. > > Linus