From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 35C0A1FD4 for ; Sat, 17 Jan 2026 00:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768608406; cv=none; b=mvndxFhW2HXfgVRTz4mEO3/RrLmJpd2g9nZqm437yxrqMdAuLX96yNog3Qmc9rvVeh5+w9lUWVhhzGf7grPEakFrqilR18DVnSMi0eFQj/JEmLUAV5RB/GGRkzfsaFurCG+ttzxkOWButeryUvJtVlVn2SsW1YicRh3ggxdySEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768608406; c=relaxed/simple; bh=Cbb0OwS1PY2jkwETG9wvSSZ9cReY1BDgkXB6tyZ4ViQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pm4W77mVCck7AuYcBj6gPpJmTDNyMVL8CqrGA8EB+/1EZfgVIrBnjXhk0xYVaBhYudP/Oved9ODe1ro0hhGy2Fl4xIpWhePRRxvMWs1BkIerCEbV3t+oaoFbImzENQy9r+0xE/ZpjewQlzYbOTblwW7kQ0C0miCEJ9QRmw76+pM= 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=R8YjtdOi; arc=none smtp.client-ip=209.85.219.54 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="R8YjtdOi" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-890228ed342so22024886d6.2 for ; Fri, 16 Jan 2026 16:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768608404; x=1769213204; 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=sDkOv8xyeBo7PdDVE07s2ucba4/fDLaQQcXd3ir6y64=; b=R8YjtdOiJYGUepUbscbM4R/SaTpN0mm+6XIeAHeJ3o2xBxWRNzebiOZDKntgunRU9t kQksNiyquiKZbGFM2Gg4RqtPLqbTc9lpQpnIJ5/VTtNXa94PGCyd1g0BJawFdN4llweB ajfCaxdgkjihzmT7knPncM2GWSLIYk9W35jTL1avvrnt7KTnyB2NqbwLQMRSTQ8vSZCb HKJT1lCnVNGKwrVQgL7sldleUoniMcSkS735fupDia8r/vhR/OuFcqGt0MLGkkwUe7Vf eF11K/9OkR6zK/fVfZ6PWQus2kfc6pmRi0DrFIioSFGpxN51EB08ZcC3zNAdWW5dsu/2 jUfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768608404; x=1769213204; 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=sDkOv8xyeBo7PdDVE07s2ucba4/fDLaQQcXd3ir6y64=; b=NlJZr3tjin31c7q5aiLQORSflqb1Mz2qX9yd2IZ9AW1oq4M0Q1obH+1sL/XCbpwmkO 6/l2NWzN7oRuAacw6hcFi+dRtav3SaxgkgSGTllS1Orkn+JTu0NsSGn2QgP2jK5+6vyR pvBbv5/k+jgFzdT0xg0W+zkFwoEtFj9GMGIlEyUvoyPCke59WZNRRa9EKFQqZttkxJ/p Tnp2di6vX2SmZucObOThD5RroZY85zL2Nw5VM2nO5lHDh0TDE4kB4kX7uT8iVOIAXqs2 bD492F5Gg3bXEM/Twg0yQnFiVibMsY190A08xfUjBiVPLrxuKUenOE0nZ966aHccEbs+ yQAQ== X-Forwarded-Encrypted: i=1; AJvYcCXn6IfiC6yl//5NDphvEyx5qMfp/l+AXUbEFGW62U/MTjMGC0Pgd8NK2y0/LKW0lRCxME2COR0/R1pNmco=@vger.kernel.org X-Gm-Message-State: AOJu0YwDxUR7ClZ+0nTPopCZfYdH3zIj2Pj1DWbMY3Bv4wkf4qhPaqyP Za/YlLnWT7rei5Oon7uej3BDwv61TbK7Z4EBW6wqOgt2C7dCrSHqiLDt X-Gm-Gg: AY/fxX5xEjHiAVjjlXvV0uUdCtvP2fA18B/AC4JYFsoClZ078uroLVR+Lti5X1/iZdG LRzYj0/eau2cmoMNityiBY/ZiE9S66AcfYrUmZ8hIEw+lPUrZOQ7vDJc3DxJnpGMe7Ff9nLAt8d IqwEwfnY5+MuH3vFVmepQA4UIi3k8kQKbEVVk0F81K/tVkslEEHuEWvg4WPekyY2yq4+1llB3Yc QclupaHQQ/YNgBemSNbTfuY/zg6qRnsPZMm4wYskPEqyPrmemdkAhM/a/Zekxz506OVao2zEJGJ oYvxXp5dTKa06+ClK0I2T7CZkb4bWz+osXOb6iSjo+o9D/pOCux5SEoWaTtX/UhBvV5CoTD0xvQ OIFBxEtAFsRqLMl3Tn82V2AxwUEZyCDrEsfG1OWeoGOPcvvZt266mdhL7U5MqVwgspt4Mlir/4t ejeju3f+22qnoPdzYAIv0z8asJxtLARqD3HhVGSkZO6UIgSBaGJQUJ1zgVcEnGyV53+PW/zFK8V qVgiehW9SC3ToA= X-Received: by 2002:a05:6214:5189:b0:7f1:c596:e1cc with SMTP id 6a1803df08f44-8942e2c9a62mr63452806d6.19.1768608403919; Fri, 16 Jan 2026 16:06:43 -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-8942e5e526dsm36097626d6.12.2026.01.16.16.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 16:06:43 -0800 (PST) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id C43F6F4008C; Fri, 16 Jan 2026 19:06:42 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Fri, 16 Jan 2026 19:06:42 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddufedtfeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefhtedvgfdtueekvdekieetieetjeeihedvteehuddujedvkedtkeefgedvvdeh tdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedviedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghlihgtvghrhihhlhesgh hoohhglhgvrdgtohhmpdhrtghpthhtohepphgruhhlmhgtkheskhgvrhhnvghlrdhorhhg pdhrtghpthhtoheplhhirghmrdhhohiflhgvthhtsehorhgrtghlvgdrtghomhdprhgtph htthhopehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopehojhgvuggrsehk vghrnhgvlhdrohhrghdprhgtphhtthhopegsjhhorhhnfegpghhhsehprhhothhonhhmrg hilhdrtghomhdprhgtphhtthhopehlohhsshhinheskhgvrhhnvghlrdhorhhgpdhrtghp thhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehtmh hgrhhoshhssehumhhitghhrdgvughu X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 16 Jan 2026 19:06:42 -0500 (EST) Date: Sat, 17 Jan 2026 08:06:40 +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: <20260116-rcu-box-v1-0-38ebfbcd53f0@google.com> On Fri, Jan 16, 2026 at 03:46:35PM +0000, Alice Ryhl wrote: > I'm sending this RFC to share an experiment I'm looking at. This may let > us replace the range allocator in Rust Binder with a maple tree. > Thank you, Alice. > An RcuBox is like a Box except that it lets you obtain a &T that > outlives the box by a grace period. It does not allow mutable access to I think the `RcuBox` can be folded into the more generic RCU pointer api [1], e.g. Rcu>> where RcuBoxInner: HasRcuHead. The benefits are at least 1) we use relaxed atomic read for RCU readers which guarantees address dependency that RCU needs under LKMM (while in the RcuBox here, we just use plain reads), 2) we also support mutable access as well. As for the progress of that effort, the Rcu atomic pointer is almost ready [2], I will likely send it early next week. For the `HasRcuHead` part, as you may be aware, I'm working on a generic `HasField` approach to avoid duplication of `Has*` trait and macros [3], that requires some syn adjustments from Gary and Benno, but they should be available next cycle. I will probably send the patches for reviews before that. Once we have that `HasRcuHead` should be easily to add. Given the WIP code I have, I *think* we are not that far from providing what you need for binder. > the inner value (Binder would probably use LockedBy for inner values). > [1]: https://lore.kernel.org/rust-for-linux/20250421164221.1121805-13-boqun.feng@gmail.com/ [2]: https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/log/?h=rust-sync [3]: https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/log/?h=rust-field Regards, Boqun > Signed-off-by: Alice Ryhl > --- > Alice Ryhl (2): > rust: rcu: add RcuBox type > rust: maple_tree: add load_rcu() > > rust/bindings/bindings_helper.h | 1 + > rust/kernel/maple_tree.rs | 52 ++++++++++++++ > rust/kernel/sync/rcu.rs | 31 ++++++++- > rust/kernel/sync/rcu/rcu_box.rs | 145 ++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 228 insertions(+), 1 deletion(-) > --- > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > change-id: 20260116-rcu-box-7a8e4c9f2180 > > Best regards, > -- > Alice Ryhl >