From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 253F01FC7 for ; Sat, 17 Jan 2026 00:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768608406; cv=none; b=Yv25h/LB/qTIcwXJkC3Icw4r8/1kET0o1aFx7siTd5uRtlZPNkoC9AsHy+hLQyYAijLHmYjnQz7D1JY/tW1voog1qquOc6iIb6iNJ3G6drCnozRnpHUIGxV8SZdR9BDL7RozPSurQBeuw2TW205d+DsqYQiBnHk9t15NPtYR6Ow= 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.50 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-f50.google.com with SMTP id 6a1803df08f44-8887f43b224so48245126d6.1 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=m/zQboz8F0EwS4niHdE2rAOXbD4BGcio0h/FINT+6dy4Mk/s5e//+qZiyP/EQxc1RD Xs7FaBRSKiyejG4Ss+LiRNIeePiBDGL40TjoSywc9ebcNxL7luiLUV0Xi9lBy/rmoJPD OfQ1SU7hiRM/XBhGYk0dJjmuyl2TLxfMey8IoYcsTdqZRqbq3l8cigX2tj6LC1m0ysvQ U2dsJQmuQmm0RWGi8H3oPLculldy+Nzljb5XjNt1dWra9Bw9bF1XzfaoePfadiAKuAzT ZaDUcuujK5Jw+8wtigvlCWnD+5sGJCAFj8PyLPJ/3ZEEO2jb1f4d7SNb3UBrNshBiDwJ xz3w== X-Forwarded-Encrypted: i=1; AJvYcCXy4cw+HmCnqLauSwT9f2bwdZ/QCQvU1SAWxF1GAvIy6oiBqLXRLOcPOtd6mXaHbfGl6s3Z8FkwcaZVCPdemw==@vger.kernel.org X-Gm-Message-State: AOJu0Yz980v1Ghubzn+ttflcXMekiqzgIkAo5i98poVhCid32lDtO/c3 7MHTCQp06z1BQU2f6IHHliZBDglONoK6OEW/0xIez7oKgYW6sObZPCzt X-Gm-Gg: AY/fxX6X51MM33B64Q81Wq555qhsr5QNxT4tyniwNqHLNmM2ncSu3fdfcSeqXmaaVhQ IundMEhqph+zEED0qTLU8jI2a92lAbiaMfJqew5BmvxCc/H7qaSR9IW1efSv9TXTXiKvCNRUORY suzzcYJQcH1fNiYfcfiN245pb//SN2hrKDXbPF8NhKS3RxYv1yV6p5WbVKXkuLBEfztjKpRQbW6 tM5N+mgkfKyqDzAbi58W/zV84uYfuxjiE57JVyj97HXB4//Xwpfd2UkVB4+oism2fJw4uHPAcwc XDEO+AYwbY3bRQCUZyjYljO3tQ9rpplSCMNzjdJdHMik3I0G/1WebYj0KD8U6Ftnp7i5d2/r2dv 7igT6+nBHOFaT98zWXvqNU/qY+5fiH07vyQ1gDhqn3jFvbFtlcVk2fyuf9qfm8Igew87NdAVT6Q KrOoArICeqz6ptlz4CoorDEYjhZiD1r+qLecf3F+vV+WRGjxZOPxMM3pg5szepaNO4iBW3SyQFJ h1y22FV6eUFlQs= 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: rust-for-linux@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 >