From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 82F123E9F7E for ; Wed, 21 Jan 2026 13:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769001253; cv=none; b=mRbMLUjHUstYYmcp3P8ec5CsVrxIlW6qKrIV1mZ67n4cF6nqPzDeqHZTymeEVOiWz6NqtvUkOJi3WSK2yqblE0BhJAjosJ4GZHysg7jvOuhd4rdgFGzaztVAzO5ZRChHNqY38a1J/rpO2Oc/+hcnzmxqUGFbtrHZQHOvE95cTzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769001253; c=relaxed/simple; bh=IeAeLFBrBEZGsR6NOogYV7pmwtcHYu0XB/ofvHW411o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D2OVXJf/QT0jTCOGNNumtNVUHmYQR0pNZ9fO0pbiIQh0EtrAzcPh5++lrEpb8bioRhU3jBdNAn3XLcv+Li6TwNIt/bq5Ptdr0BN/ExHZiIe+lWaXxcgn7cTqRB9XetQFS9rRv5zEYvr3sKwAOqVKOc+RtJLkDi32B2NbxAKquUU= 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=OnFc/D7W; arc=none smtp.client-ip=209.85.160.179 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="OnFc/D7W" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-502a407dabaso44205311cf.0 for ; Wed, 21 Jan 2026 05:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769001250; x=1769606050; 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=/HQDkqfe8wWRgLYxMvvzfKdW4MZONwsks3Mx1gvqFM4=; b=OnFc/D7Wjm35O4fqBza+uRWnYjZ58ZIMKAEyXbGfJvi20qrJ9qxBSdjtkZNMA2IbLM bsHoPQXMz2EAjSoAAwG21HWvU++YQtYBo6lHkH3dNODwOaxi6bPusc6cBDvPwvZUbYx3 puJnj0RI+2vw+IZEuKHUpyfa4FDY8/ykK3b5z8SUpFlplFZs789rdpgUkoNHQFpo1xa6 2nSTqalmL9zTokFuNbz0XwJ7Agl4iDD6LhizvSDVY697896Wbut4/0SSy7zyLcHz7bqR ydZEHAxZ1rCF+BGD2opfj4JzKVln6Oc5/G/RLHTbKLlr/vJTa/m3tcYqcvQ6zAEBikJ9 vI/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769001250; x=1769606050; 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=/HQDkqfe8wWRgLYxMvvzfKdW4MZONwsks3Mx1gvqFM4=; b=JhNClWfNHL2bnRmsJ7krSfC6P/mwYm91ZBnogKKnCZXQUD9JjKruHEkBpD/qI6vxJY tuTzirVrvhWwTFXDwaAKJ5fI2w7/EjkavqvLcbMbAOr0qCVe7kGhGMe8wpxRIR72+Nin /SIcDn13PT3z15CcNasStGP3uS1ZOPyPEkiIWjno5ehUCQ+QQbKO9XMNWHgXTm73pvwL dSj6Yf0Ve6MJDZjsw/TVZ5nzjw/f7td7MilDE7HCEk1GyRj2ietghB1xspNN8Qshq18T qGWKQDJn5mdL/LgmXCr9xok/+zfLhdPvrxZlYFJTzOuRR72D5EWM62Q5Du/sx+mC7dlz amrw== X-Forwarded-Encrypted: i=1; AJvYcCVKiz4WbWrQyOuasUMOkK0RwoMQ97K6w82hH5qx7XtCWn3XmoxdNYKp7hBLtzlTsk4/229yCKd5uLXilkM=@vger.kernel.org X-Gm-Message-State: AOJu0YzBn7Bi8ITbg7YXeBuQRuZYwJxZsoQzxGjoTfvKrPEhdVJpO3yu lJyZOEua6XNR9ZLZJSRjD4USzpM3R1KN9IvPrsGTff+LhriTGHUthi4L X-Gm-Gg: AZuq6aKZ3HWr6GeES/C0EwzF8fNqiPH3vRJ81hcn8DlkUW/ppHtg3NTUFMdRXYVgo33 WHRPfQzQGM5Gb9Dh3JAbB9NJAq95jRmpEnIl6bLLsbuDNBFUx8CS6jWxyI0dadSQrAlw85TOCWq hPrbcbOOR0j3tmZBgFLWYec6vE+4kkLddF/1amoFiMCYGlqIIQsatrK0SmtaMUQzOJ1vExhZWLo h+7Qt216YZ+PJqZfUORrACPyWrrxey5ZDiQJQp4pVM6azcTeqE8AKm7YLgyzC/tAG4HXsnHAB3b jUwKYAitivGR+bRivjdOtWaF8Kycwhs8NmmvdRgWIHrvW71/PbEP7T9KxO+VCGoqr4iiLpViKLP c3ZzuLVK5O3UY20YFbU64OO4FyMWS/Fz+7K4c6XSYpeL9gw2VkEl2WrwAa+M+H20sY83Z7suFqa xYtmdXEbm4JKhlMvWZbOkn3NfIcofFxhkwWrSqH8JAkykrzWDYCF+opH5XOmAZnSu2AJ2TO/6BJ MZK1YFQMGIMNHHQqD3GDtrhpQ== X-Received: by 2002:a05:622a:1805:b0:502:99c9:591e with SMTP id d75a77b69052e-502a16b3a66mr243793681cf.38.1769001250090; Wed, 21 Jan 2026 05:14:10 -0800 (PST) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8942e6d7302sm124098106d6.52.2026.01.21.05.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 05:14:09 -0800 (PST) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 007D7F4006A; Wed, 21 Jan 2026 08:14:08 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 21 Jan 2026 08:14:08 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeeffeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefhiedtieekleduledtgfelvdejffdvjeevvdefjedugeegffekjeeiiefhieff veenucffohhmrghinhepthigthdrhihouhenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshho nhgrlhhithihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngh eppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghmvgdpnhgspghrtghpthhtohepvdei pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhhitggvrhihhhhlsehgohhogh hlvgdrtghomhdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgt phhtthhopehlihgrmhdrhhhofihlvghtthesohhrrggtlhgvrdgtohhmpdhrtghpthhtoh epghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurgeskhgvrhhn vghlrdhorhhgpdhrtghpthhtohepsghjohhrnhefpghghhesphhrohhtohhnmhgrihhlrd gtohhmpdhrtghpthhtoheplhhoshhsihhnsehkvghrnhgvlhdrohhrghdprhgtphhtthho pegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhmghhroh hsshesuhhmihgthhdrvgguuh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jan 2026 08:14:07 -0500 (EST) Date: Wed, 21 Jan 2026 21:14:05 +0800 From: Boqun Feng To: Alice Ryhl Cc: "Paul E. McKenney" , "Liam R. Howlett" , Gary Guo , Miguel Ojeda , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Ballance , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, rcu@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH RFC 0/2] rcu box container for Rust + maple tree load_rcu Message-ID: References: <20260116-rcu-box-v1-0-38ebfbcd53f0@google.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 12:10:54PM +0000, Alice Ryhl wrote: > On Sat, Jan 17, 2026 at 10:00:19PM +0800, Boqun Feng wrote: > > On Sat, Jan 17, 2026 at 01:12:08PM +0000, Alice Ryhl wrote: > > [...] > > > > > 1) "relaxed atomic" does not sound like something that provides an > > > > > address dependency to me. > > > > > > > > If you look at rcu_dereference(), it's a READ_ONCE(), which is the same > > > > as a relaxed atomic load, and yes in LKMM, relaxed atomic load provides > > > > address dependency (Please see the DEPENDENCY part in > > > > tools/memory-model/Documentation/explanation.txt). > > > > > > You argued that we should rename READ_ONCE() to atomic load on that > > > other patch series because "atomic load" naming is better than what LKMM > > > normally uses. Fine, but relaxed atomic load is a much worse name than > > > > To be clear, in that series, my argument was not about naming, it's > > about READ_ONCE() being more powerful than atomic load (no, not because > > of address dependency, they are the same on that, it's because of the > > behaviors of them regarding a current access on the same memory > > location), and we want user to specify the intention more clearly. > > Expressing intent more clearly is fine with me. I still think it's weird > for us to not have READ_ONCE() when it's a primitive operation of our > memory model, though. > But in our memory model, it's exact the same as atomic_read() (see tools/memory-model/linux-kernel.def and search for "atomic_read"), so why do we want to have both? ;-) > And I also think we should consider using an implementation along the > lines of what I shared for our atomic_load() or READ_ONCE() or whatever > you wish to call it. The perf impact of helpers makes me sad. > I'm not totally against that, it'll actually help Atomic as well, I also hope that we can use `asm!()` to implement the cases where `{read,write}_volatile()` cannot cover. However currently I would rely on helper inlining to resolve this to avoid duplicate implementations. > > > READ_ONCE() if what you want to convey is "has address dependency". > > > That's not what "relaxed" means! > > > > > > > Also note that my previous reply was explaining why we don't need to > > call rcu_dereference() from Rust, because implementation-wise the > > LKMM relaxed atomic load provides the address dependency. Depending on > > what we want to do, we can limit this address dependency only to > > rcu_dereference() and make it a special case, this means we disallow the > > address dependency provided by the "relaxed" in normal cases. Or we can > > add a Consume ordering (a type alias to Relaxed) that makes user to > > explicitly use it when they rely on the address dependency. I think > > either would resolve your concern about the name of "relaxed". > > Yes, I suppose that would resolve my concern about the name. > > Well, I do have one partial concern there, which is that the wrong name > will show up in stack traces as long as helpers are used. > I think it won't be a problem since in LKMM, atomic_read() and READ_ONCE() are identical. Regards, Boqun > > > I suppose you can argue that the word "relaxed" means different things > > > in LKMM than it does elsewhere, but I looked over the doc you mentioned, > > > and there the LKMM calls said operation READ_ONCE(). The word "relaxed" > > > does not appear even once. If we're going to change terminology / use > > > new terminology, let's at least pick terminology that's not > > > contradictory with the rest of the world. > > > [...]