From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 6450B1940A1 for ; Sat, 17 Jan 2026 14:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768658427; cv=none; b=CCBtg8KC8IyNcfYNtRrpRvNjBXM25Tc+IMQV5iJEYsMVXltrfxNq5anhgaSDQEaEY+oJL4TbmjZdcLUQ+mPCjOSjC2HR7mq1y4sEyWcnoP9vivfJt1yRnYEqgUfY0I2l5tvf7+fHTCvjvAed9beizdwkMJM0XVYt4xrglcLX8QQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768658427; c=relaxed/simple; bh=LP+ORoEV3x/QOEgVwF/qJFp8kv1xIYx689aAuRe32Gw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jzXXdvqnS2NePeY6pubiH/MatXj5TARfe9lUioa4GsoUlIJnLUBY02RPC6BFT2IeZr6OA2I5ZJJ81WK0hySrdA5lDe+Z3PA2G4kNZV6Gov4tcOrwNv68pcQKRYrvsqO+aBRNshS59B+86t1CqGNSSHV0fSiHhPDHiMGNwHeYpsE= 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=gd6Ucvqi; arc=none smtp.client-ip=209.85.219.45 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="gd6Ucvqi" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-88a35a00506so45694316d6.2 for ; Sat, 17 Jan 2026 06:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768658425; x=1769263225; 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=JsJhzSv+BLOqNKc20ETcfR3RCpxEZPWqckGeyhc9dbE=; b=gd6UcvqiAMfl4rZbbuBXq/cWWRQP57hXakHoglN8YbILHkhEYF5HlAa+JPYSsEQ6Uj tTA3y2A5stoHkT42CrGyCIhZ1UsczEHl4fmUGoHd8duv7Tpdshr2dsJeZ8wr4iBX0q0D 4bhKJHH/oq/5kxTvlKDmQHe+anVvgIRyUumvj+GyMQqn8LhF1vNRYrlHrzmhc1/JF54f GkYP9WMEKMfW5+III08WMzavdVICPYDF9VqG+DOY8JZ62kA3RnwYq0TBgrpY6Jc+pXZZ i4VM6M+woMuKlrpD8JCgcI92emRZQ6UvYVzyu+a5pruZL/rbLXLoa2WTaZnTKthvky5J Ph7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768658425; x=1769263225; 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=JsJhzSv+BLOqNKc20ETcfR3RCpxEZPWqckGeyhc9dbE=; b=mVS977e8ZzkJYJuAXnMuQpBClgJRebpbjalGiceFTFYQHidNPtq3Oj5VdUJsaURW5O AhQBq8nRmo2zeOh6dt2AZLc6yFvhGcXY+wWzUJDHyyezidA5pZ7JZJBNUG48iGtwagg/ aw1jkgcD9SwuYEWRUpMHzvE5rhBkDSzFhp5HiCCnNxjUrHMwLMfTRh0TYdsdGg114z0R Pw2CwtIQua2Xn2gk594n6uAp8wabM+Kwdv0dYjByVuLD3Hsn0B57B0AS1bkrWEqI63Xo HRCV+hXEEt9O0TnTDcK3w61oL9qBZMEHna6vUMkKuKpyetczAdPy6OF0+S9koYPESGek NqIQ== X-Forwarded-Encrypted: i=1; AJvYcCXNHKG4zOlG1dOKWiKaOPbvCukEhwL1jdoAISq8mges60iE8GBHFFU/8KCWuUAqpv2CJI/9MI8UHA0zaLo=@vger.kernel.org X-Gm-Message-State: AOJu0YwWE4y2Za8BkhsypujFKNqUk1E+9yLmD7foch6k3gpLnPmTef2r sb8bvCx5+MsEorggWXx2PkDYz2wsq4RVNJOkkd/Bz1oOoPqEeeyXWpnN X-Gm-Gg: AY/fxX49fhY+lLp51LnUbwXMAeA8XqmP9ERYGdyCeUQtDKL3g3lEJz4NmPvWN6PY1Is kG9HSCJF/JZckZlj4FpHBvlUqZ9NZkaJ31vEtsvUe0UaOOsnWQMuvLVZLRa6F2R6SDqAMDX4KXb ChijzD9O/3laGALO/r+awwmGYWtdY1ZSYPd0hPEg6ef6WOgc5V1UshSkP1lVfZJJNb6wk87LaiG spBbERWl1aBjvzN5wd7fQRKnySNVCDHLubrH8gpeEIjpmJFPgwDqW7/d3pfOACgX35tXKaJoBgo cBCARL7xK6QprR+mMQiu29v0R/MN75piDCHhr8RDaD8opscp3xJwVjz5u/7D8k7f2EFZitCsAgm uuKM80QFSSNivDpN5kNRSt5M8LanaOhz/aRUPvBFn0w6qUV+J0HJDGN7DXxd8wRJD+T99dKGAOV 4tXB0VSKcegftPH6gpfHRD8NtqpLGAR6VJOwIcCUUXq4whH5YojahrBzQLlooJVRn6fSZmopRzb fSblZBJuduPBK0= X-Received: by 2002:ac8:5d13:0:b0:4ff:b211:6aa6 with SMTP id d75a77b69052e-502a1e08f85mr93551061cf.27.1768658424583; Sat, 17 Jan 2026 06:00:24 -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 d75a77b69052e-502a1ef9847sm44608071cf.26.2026.01.17.06.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jan 2026 06:00:24 -0800 (PST) Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfauth.phl.internal (Postfix) with ESMTP id 52A8AF4006E; Sat, 17 Jan 2026 09:00:22 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Sat, 17 Jan 2026 09:00:22 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddufedvtddtucetufdoteggodetrf 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; Sat, 17 Jan 2026 09:00:21 -0500 (EST) Date: Sat, 17 Jan 2026 22:00:19 +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 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. > 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". > 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. > > > > 2) How do you intend to provide mutable access? By waiting a grace > > > period? > > > > Please see the {read_}copy_update() in the RCU patches that I linked. > > In short, you don't wait a grace for mutable access, since in RCU, > > readers don't block updaters, but instead updater will copy the object, > > atomically update the pointer and then get an `RcuOld`, > > which you can either synchronize_rcu() or {call,kfree}_rcu(). > > Hm, ok. I don't really need that. What I want rcu for is the internal > maple tree data structure, so mtree_load() doesn't need to block on the > maple tree internal spinlock. The contents of the box would be protected > by a separate lock (probably via LockedBy). > You mean after `load_rcu()`, we could access mutably by a lock? You need to hold that lock and the rcu_read_lock() while mutably accessing the return of `load_rcu()`, right? That is basically using RCU as a proof for existence. Regards, Boqun