From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 17DF63ECBC2 for ; Wed, 21 Jan 2026 12:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768999916; cv=none; b=mKPgnYwPqQjPSnKb2MRw56Upst/DHT6wNwAeEiwEVaVUVMYHDKzHLxnApXVavUcAQY/02BN5IjL00yFYwSpXMZaNnzzm2fAqmZXn1nBYxtRmD/td33fdEjdPhhmpXXZNX58ouet7+kjueuBTziWQCGckBAG0PV3Bqrg1XUALvPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768999916; c=relaxed/simple; bh=rCJVN3mlY/He+ltCptalObxFFliAQg62cnToC5h9nm4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YR6VFNizdPc4GdFgkCkiU75gAfWMoBJ2qE8ihozHcAy8fi3mPduV8USTbI/tG31BZVmoDJxA7737M9Cm9bP9pRTb4ylJlrXb1o/Moz8zIMzETN8joyf/dFPe/6c4yBA5iarmWwLHQF+15blsFYhYzqz2uDl9KK3EoAKy6qLdHZE= 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=dzohWtPN; arc=none smtp.client-ip=209.85.222.172 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="dzohWtPN" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-8c655e0ee70so689121185a.3 for ; Wed, 21 Jan 2026 04:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768999914; x=1769604714; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=Ff1eounqvwFWz5fvkxu9F0ExQjANboKm57xpRsw3Ti0=; b=dzohWtPNJPGs5Ql2vW5x94bHwtVSlSweONpyQYd3FJ7/4fe0I35ixpp865jqSEyifK SzNQvpR6XUcub7W2cUZeeqyCyjh0QUJfpymMlJesOLSYsfZQIEjm9GcMTIIrBXhwWz33 zYIzLpFmk9Pumk99ALC4//Z1oYQVhs5QyzcmAl0oUXA+j3dgH8tTy9HFk3pAjaaYMqqz L7JIJucXuZVvwBYpGON3wxHF/zB3qbO//MUxwqyRhJY23cLe9G8GggiH2elqiTnL7VPd noAhyTtaQ6OietXTdS4kiY2sEI07zbZpMCGg388BnkJIXnf3K29m7B+7RVd5RuJXlDdy O8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768999914; x=1769604714; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ff1eounqvwFWz5fvkxu9F0ExQjANboKm57xpRsw3Ti0=; b=mhpxlBOCcvHh8b0OXZ7Zlik9NR5JEl41rDomGhMAog5cGUAnOz0g1PZxtgamaX5Q69 5jj7dp/+JJy79Rg3SNvW1HIGNXt3r3nKn63057fwBC3orTFgv279KPg7CZVC9a+U5D4U hbd4RvRl2MrLXHj0U2V9Iy8FIzjDnPBgBwy3FiMCO7dAYaXicqn0EcgjzEAlz2hgKkTj yqzIN1bJGHGgAuk5CH22NjKhQ8y4U3DqXnn3rSrmW0pJlPu9WuoMAQ5R5TPVZBkbOcTi et9OOgRyeK0QvbAR1j+ktemYdVA+WpbuhJtkoE+j6kobGrkq+Z5MXcSqmvITL899zUVR tgcw== X-Forwarded-Encrypted: i=1; AJvYcCUzogMjxsD2NzeDYBaa7DlI7MDAJ1JPLHqbLVSroN0aEISjwKMTDBpkbg7c9zAD3jfEUgm87ARSvTZj0Ww=@vger.kernel.org X-Gm-Message-State: AOJu0YzLKoypuVLoqml+LUlGeSMTNuidaLmkLHldHuOBLwOYQ1LGkVLo vpaW06nu4pbx2KpNG/gGLcrivSenuiM+rDa+sCdSS1fgDIXxmRq+a+8A X-Gm-Gg: AZuq6aJKc60AqCvi/441xLEvuytR5VKbc3r+XlBK78H7I0ih4D69sxnF+rQN0j/7QXV HO79ajrc8OQh+GqOxy0qrYK3EWAwpm1bmN3Y/DRMQZapzuV4t6YB/WGLJPuKPVA9MKRMN+lYK3q yd2ZZCTnNJZ3bLVGfPX63y1Z600atDgKcrJt1DQm+aTIuizhhnJJfJRWtxo/oRyB+GqFT93+f+e u+hVY3mxtjJGn0T8sAJ+yUBotayFCLmGv994sm50LRQtiuxlIUoyRhUg+5hQNX2tZr9NDuDyFjU aobwBC0Ng4NU7eegtb02NRB7lgVAisoUis7TsZKF2GoMEkA1v9ggP4DmbNAAUqDwfsRshqsiOiw UHy/8UY4sewMz7K1tFPvrkbbbzFwVwDFZQ8qjyDJ/uJ2++p4On9ZuXc9CAMSjMIs1Fvme9boctK wi8OT2xlnwgLFabwsPKm2cDoKP624bjp36CpO0WL6ILsmgfA6Dc3A/mhRJBrPaqGkQBMa73w7cI aUh4vEOpfJU5Qo= X-Received: by 2002:a05:620a:4720:b0:8c5:310d:3b2a with SMTP id af79cd13be357-8c6ccdbeeb5mr646477385a.19.1768999913732; Wed, 21 Jan 2026 04:51:53 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8942e6c9b83sm124581826d6.46.2026.01.21.04.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 04:51:53 -0800 (PST) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id E712CF4006A; Wed, 21 Jan 2026 07:51:51 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 21 Jan 2026 07:51:51 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeeffedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueevieduffei vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvgdpnhgspghrtghpthhtohepvddtpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopegvlhhvvghrsehgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhitggvrh ihhhhlsehgohhoghhlvgdrtghomhdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlh drohhrghdprhgtphhtthhopehruhhsthdqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghr nhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkh gvrhhnvghlrdhorhhgpdhrtghpthhtohepkhgrshgrnhdquggvvhesghhoohhglhgvghhr ohhuphhsrdgtohhmpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtph htthhopehpvghtvghriiesihhnfhhrrgguvggrugdrohhrgh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jan 2026 07:51:51 -0500 (EST) Date: Wed, 21 Jan 2026 20:51:48 +0800 From: Boqun Feng To: Marco Elver Cc: Alice Ryhl , Gary Guo , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org, kasan-dev@googlegroups.com, Will Deacon , Peter Zijlstra , Mark Rutland , Miguel Ojeda , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Elle Rhumsaa , "Paul E. McKenney" , FUJITA Tomonori Subject: Re: [PATCH 2/2] rust: sync: atomic: Add atomic operation helpers over raw pointers Message-ID: References: <20260120115207.55318-1-boqun.feng@gmail.com> <20260120115207.55318-3-boqun.feng@gmail.com> 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 Wed, Jan 21, 2026 at 01:36:04PM +0100, Marco Elver wrote: [..] > > > > > However this will mean that Rust code will have one more ordering than the C > > > API, so I am keen on knowing how Boqun, Paul, Peter and others think about this. > > > > On that point, my suggestion would be to use the standard LKMM naming > > such as rcu_dereference() or READ_ONCE(). I don't think we should confuse Rust users that `READ_ONCE()` has dependency orderings but `atomc_load()` doesn't. They are the same on the aspect. One of the reasons that I don't want to introduce rcu_dereference() and READ_ONCE() on Rust side is exactly this, they are the same at LKMM level, so should not be treated differently. > > > > I'm told that READ_ONCE() apparently has stronger guarantees than an > > atomic consume load, but I'm not clear on what they are. > > It's also meant to enforce ordering through control-dependencies, such as: > > if (READ_ONCE(x)) WRITE_ONCE(y, 1); Note that it also applies to atomic_read() and atomic_set() as well. Regards, Boqun