From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 BA46D36B066 for ; Tue, 17 Feb 2026 14:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771338344; cv=none; b=P8OlfUGTWvCOvjGwjyhMKiih47GGYHMLlAIwYQg87n1MPg1jJWu4GQJ5ScVzbbxRgK7gku7qg2llhKg6/IFi1j3qMdBea/eMK60EF9G2yMQaXF8nTe9IYaHHIj2QUZ27Q+H7Yo/cmw0Lh0gVLNjmaYapyVA2X/9wkhbVHXJRsFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771338344; c=relaxed/simple; bh=G+OrCFla/Rc4tWD0fYhTe1r069MWscvSk996gXlONiA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RMI1awrXV1mHmKFHlJ/KggKIM7VYPFvLq4CLZJUBDv7vKwrroimLaLxQeMucLupjVX9gzfc5YUHKy4RW9rKzIL8Vaxe7kV4PVPNhJ9PtorZsTDi3Ti/Mnj3+DSiM/SN6vyVUFFuYVgQncR80WTO1/NH069UA76x6zJlAPzD7G24= 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=VbSv2Xqf; arc=none smtp.client-ip=209.85.128.65 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VbSv2Xqf" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-48371bb515eso48717555e9.1 for ; Tue, 17 Feb 2026 06:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771338341; x=1771943141; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=7Eu+fC1NvwDc2c+7+RBywzqoe1LU54TndFGYyJ2KsHU=; b=VbSv2XqfU83xFZPF7jN5assBWMKVNf86RsKs/iqkSj0kGOJjyjpg8mdJLLVLOKvrAz KILb/NxXPP8OH0W6IDvwXJ7xuIO78B7BfzZy12EC5u03QHfwyOMxJ998dTrNCevG2OmR N4abiKuvwfqkwPP3qR/HGqr6gADCeveQjcv5mA1oMUT8Y4migxy83pkd2HTX8cIqBUwk cUYBEZZAHuGGEujb2MKe2w0X1OHfUofy36vLeXaL4BO6dRJ2PGcd9JiSP/aZR0GBZZfP aOWRhASZN7v8k+J+GJUG7icNtTrn3WjTJSlmcIVd6VM0w5TEplhbPaPdUslE1k5zmhum yWzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771338341; x=1771943141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7Eu+fC1NvwDc2c+7+RBywzqoe1LU54TndFGYyJ2KsHU=; b=Q9adPYtXjh68EPnEJoz5mcDiU4w7JJyY+0VDpJadc9swkwSo4TQOibStgwf0c340GQ vsEcuocdnYSqOs2V6GAW3/dhJ/uAQA7ecZIgK5pQaLm5xw5YNe3M0xv+3hilwuCR5Ovi 2Xn0xSA8ppodOyXf2A1Jd1hqNgxAhJaf+qsEN/6nsteDaND8W/RGB5JnhDLzkqLYsiUp GCUWHODfw2jTgxTjfS171tt8kA4a5GLNfmmPUxhMoDFAH1P3dq6bUhnAV7zDQEBNBXop gxfF0H+Wp9iIlKe9XiCSWqU5eT5fLizAoouQSchISd9RXmWVq99mYK6zy61BQTJTrQHh CSNg== X-Forwarded-Encrypted: i=1; AJvYcCWaFWymSi+EpkQFvyDjIl/6J/7O/3GqqnYHAL1V9LzIYj9of9LGnSUWrjjjQhcKLBZ0OhE7AvzVtFCsLts=@vger.kernel.org X-Gm-Message-State: AOJu0YxOT1feSIwUpPY9E/CzwjucsuFiWvaBxTN5tb6K1dz6iVLjb1wh ueuXzY22OGrPhe6uVCKqZiYhyhQ4aNzggAG2JXGYRo4Q8hJ85xkYjYtc X-Gm-Gg: AZuq6aLpSLTm9h+ir5pYzk83pkhBYRYOMtrw8ao+ZO9Zotbi2Y2jKYJkwCnruGp0F05 bSr2HvWA3wAu3QmZTK8O0E5fOBFiUPMgbAERg6M1tzj83kAUBnLuyfcmCKZDKbNa7naEIZa/LFT MDFvI9K2oOJWPAVjZOMrXjzFv2hDg7bCNpZEIeCQ4cjXcajSDonD31pN0Szeu7oE0rrWhY8zT9c V22tbTbnd+or1LyT6spR21/QmunTGMPHq/jfV+k8F7olbTLQa911vk9t00DhC4L2mP7dIcDpOMJ 1L3Q7GPQDM6HkMKpC/mlQvOXSlUNkSnvs7zU7uKFv6WuhqlT0Sz67rwOQD+nBKVzAdt3dLsu5+K 0kElxtVTJe4mB96ILXvbBxaKYpBLlmBPL+DGVDHB9kjvntEVL/LWjs+IluzwkAUcDhJ5cq+R+3Z ZY3vnKxP1FwgIA+qaeSt6LfoukEQf1c4Sk6mvYu3GDfY58uwfOi8I875RJTalOqJPe X-Received: by 2002:a05:600c:6206:b0:477:b642:9dc1 with SMTP id 5b1f17b1804b1-48373a5ba9cmr225553315e9.20.1771338340859; Tue, 17 Feb 2026 06:25:40 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d5d77b3sm570714265e9.2.2026.02.17.06.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 06:25:40 -0800 (PST) Date: Tue, 17 Feb 2026 14:25:38 +0000 From: David Laight To: Peter Zijlstra Cc: Linus Torvalds , Marco Elver , Will Deacon , 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 , Boqun Feng , Al Viro Subject: Re: [PATCH v3 3/3] arm64, compiler-context-analysis: Permit alias analysis through __READ_ONCE() with CONFIG_LTO=y Message-ID: <20260217142538.0a2c0892@pumpkin> In-Reply-To: <20260217121619.GA1395266@noisy.programming.kicks-ass.net> References: <20260206182650.6c21b0ff@pumpkin> <20260215221656.68b2fc1d@pumpkin> <20260216110915.4f0d5490@pumpkin> <20260216174324.75d47e37@pumpkin> <20260217121619.GA1395266@noisy.programming.kicks-ass.net> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Tue, 17 Feb 2026 13:16:19 +0100 Peter Zijlstra wrote: > On Mon, Feb 16, 2026 at 05:43:24PM +0000, David Laight wrote: > > On Mon, 16 Feb 2026 07:32:53 -0800 > > Linus Torvalds wrote: > > > > > On Mon, 16 Feb 2026 at 03:09, David Laight wrote: > > > > > > > > volatile structure members are almost free > > > > > > No, gcc does absolutely horrible things with volatiles. It disables a > > > lot of very basic stuff. > > > > > > Try doing something as simple as a "var++" on a volatile, and cry. > > > > On x86 I just see a load, inc, store - not that surprising really. > > (clang did do 'inc memory'.) > > > > It's not as though 'inc memory' is atomic (without a lock prefix). > > > > Also var++ will be 3 u-ops the same as the read, inc, write so the > > underlying execution is much the same (ok you might save on the > > address generation and the compiler doesn't have to find a register name, > > but I don't remember anything modern being limited by instruction retirement). > > You might save a bit of I-cache. > > Interrupts can tell the difference, and that matters. Just makes it the same as every other architecture. The only way to guarantee an 'add to memory' instruction is to use an asm statement. David