From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 489681DBB13; Thu, 25 Sep 2025 18:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758824253; cv=none; b=RiJaFrEj1ni1KbDof0jx0MHvAHlydSpF4aRFdeNnM5rI+0IPRiE6sQbfMXs7Be/9vGglo8jIPVqoRC78KhMIsoqjONrrmxXWqjh8u0gGDgvpmnU0qsQC+IHxNB5DeZmZt+H0a00sbdKXjnZ6MfWf82OSerS9RqviUAXYIkcJdMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758824253; c=relaxed/simple; bh=vplUSjg+R+HU5CjzMqQFgUqhUMUeCAKMeinKHcOnjpc=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=CuU9zToTGcguGUpLZkWxbW2Y8sMIiHjUjTxlZzopkFiLmjJx/ZBWpBmkTM11ZLhwf63k1E92Ik/IxIBWMaKfewlThzvHhdWJ3xoJxVouPtpNNoX7qX3qO4B54Q9NloY4SRB/ZP0cKM3+kYtFmlkVTzenRTWKwAZdfMhpS+Tkk0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=snnSx2Jo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="snnSx2Jo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F635C4CEF0; Thu, 25 Sep 2025 18:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758824252; bh=vplUSjg+R+HU5CjzMqQFgUqhUMUeCAKMeinKHcOnjpc=; h=Date:From:Subject:Cc:To:References:In-Reply-To:From; b=snnSx2JoG2IMBMWuBuo4PaawWerSZyp3dENX1M7wJ/+jZc/ei+/XX8wlr+waqZlKb R/87WQ7tlZqfNw0lxyMTm26eFFnyKPV/kf45PjT5+uugertGzUgkUXrauEHDIv584e VFADaX0sCXb11+G+QAPM7z9L4Mm2QYKKcLtuQFCbpdPXP1wOX7+j5HpoSHkEinTi4+ 2v42bc7xs1bfqJnmGjNZDym5CiEQliz0jnzSDbWxIndVjQqV/tO4AdG4zeWUZw8RWY 3sjCJiI2Sf96/nihtSkC4t+E+AIi+vuPyq6hswpW6UpbFppBZO+XEqHiWi65YLESnf NLagdblxfDkOA== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 25 Sep 2025 20:17:27 +0200 Message-Id: From: "Danilo Krummrich" Subject: Re: [PATCH] rust: slab: add basic slab module Cc: "Elijah Wright" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , , , "Lorenzo Stoakes" , "Vlastimil Babka" , "Liam R. Howlett" , "Uladzislau Rezki" , To: "Elijah" References: <20250924193643.4001-1-git@elijahs.space> <73d7d53f-439b-44a9-98ca-0b1c8fbc1661@elijahs.space> <6e9c820f-070b-409e-ac25-af96b8b962c6@elijahs.space> In-Reply-To: On Thu Sep 25, 2025 at 8:15 PM CEST, Danilo Krummrich wrote: > On Thu Sep 25, 2025 at 8:05 PM CEST, Elijah wrote: >> On 9/25/2025 10:43 AM, Danilo Krummrich wrote: >> >> > Anyways, I'd also like to hear some more opinions, especially=20 >> regarding (4), as >> > mentioned. >> >> ok I just looked it over. I think (4) isn't really viable, the cache=20 >> pointer storage overhead is probably too much (in addition to some=20 >> complex issues). > > Probably, given that kmemcache is meant to be used when we have a lot of = (small) > allocations. > > However, I'd like to hear from the MM folks, if there may be options in t= he > existing infrastructure, or if it's really a dead end. > > What are the other complex issues you are referring to? > >> I don't really like having a macro (so (3) basically)=20 >> and I think there are issues with non-static caches, I don't know=20 >> specifically though. obviously (1) doesn't work. (2) is exactly what I= =20 >> was thinking specifically for rbtree. IMO the only useful options are=20 >> (2) and (3). I would say maybe implement (2) first and if you want=20 >> macro-generated ZST allocators they can wrap whatever that Box ends up= =20 >> being. > > I'm not sold on duplicating the Box code just yet. What issues are you re= ferring > to? Also, if we argue that (4) has a problem with scalability, then (2) has the problem as well.