From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BBC0CD3429 for ; Tue, 3 Sep 2024 11:56:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B3038D0164; Tue, 3 Sep 2024 07:56:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 263498D015F; Tue, 3 Sep 2024 07:56:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12B3D8D0164; Tue, 3 Sep 2024 07:56:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E80648D015F for ; Tue, 3 Sep 2024 07:56:38 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9A2D5C0CC0 for ; Tue, 3 Sep 2024 11:56:38 +0000 (UTC) X-FDA: 82523274876.02.25931CD Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf02.hostedemail.com (Postfix) with ESMTP id F208580004 for ; Tue, 3 Sep 2024 11:56:35 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="goFHb/NV"; spf=pass (imf02.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725364501; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oIPnDqVIO1/HPWkXhaIUWKtx7u96wD/THzJel8vjchs=; b=MIwkEyVq32cqxY7N7AYB0x33H3OopwNgBAjHnjPfcvH90aU+Rho2Tow/e4wLA2YBz4ZFuS U+qliKbC9eVXWOOGiQDAxJOaaSHb0dcw2VC9gp1KadTUbXnlOLsQ/47PK+gNpFr49rNlNe VcoPh0g75QJPbJIK+JJPQrk4WSF7srQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725364501; a=rsa-sha256; cv=none; b=HfzATMZ+gKKfeAqaNc98YNffswX3M4gQW8dcLNP31NA0xtYS1gPEwj0OvjH73AxbeYbDbH zcT4BGXlPDNmb4Z3uGY88jX+/BuE/8lsqafS6RgQcpRchuqa9UkPgsfBJJnbSnS8JHTCiX dTPJU5ZIzu62FCpmF6VWv3HjgDIJMSY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="goFHb/NV"; spf=pass (imf02.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 51D085C5966; Tue, 3 Sep 2024 11:56:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C280AC4CEC4; Tue, 3 Sep 2024 11:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725364594; bh=0zDsuJ5lW1nyARE4wtBvC9CZFQt76AfHnSgA1z+UpPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=goFHb/NVyfUwbKhLKJ2UYfleAJrAn+IdbWMH1igvXp2PF8viVN/lNuzaY2QUpiuBg FQROMe7MCudg0NxbhRfo1WQtfo5WELXFLXoEuuKL48ZKa+Z1LEcEF+P1o7UogXw1vS M4YMnaG8ZIvELBvXtVkt4WnfFJtJM38IY/b9mEucb5Mf/EJei+KdTvzZ0f2pWG7OZc Rwr2jFxq07hHVIkmsLtt0a4QPCTnUxdgMpUYUHEUdx5V7EJZJjVgiP3vyBqoP1fofd 0xo1x31nEg2IJDYxy3hsJ5WDoqFGTODqz5JrG5eq54e/F2ZMVzSbvaqQIGgEgwsD6w ViDOb23ShhGlQ== Date: Tue, 3 Sep 2024 13:56:26 +0200 From: Danilo Krummrich To: Benno Lossin Cc: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, a.hindborg@samsung.com, aliceryhl@google.com, akpm@linux-foundation.org, daniel.almeida@collabora.com, faith.ekstrand@collabora.com, boris.brezillon@collabora.com, lina@asahilina.net, mcanal@igalia.com, zhiw@nvidia.com, cjia@nvidia.com, jhubbard@nvidia.com, airlied@redhat.com, ajanulgu@redhat.com, lyude@redhat.com, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v6 01/26] rust: alloc: add `Allocator` trait Message-ID: References: <20240816001216.26575-1-dakr@kernel.org> <20240816001216.26575-2-dakr@kernel.org> <60253988-37e7-4acb-b2ae-748b30a4ac21@proton.me> <44b80095-8b03-4558-967e-138ea712f780@proton.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44b80095-8b03-4558-967e-138ea712f780@proton.me> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F208580004 X-Stat-Signature: 7sebqoqqax9dz15z9ao7fup88kuraria X-HE-Tag: 1725364595-886372 X-HE-Meta: U2FsdGVkX1+yM0SJf8LteUHopQVSpNYUytKYhsGxL9+E0HIdiltmE1nL3xmX+BfISv9CHg/5QPvr4UvyZcvhaIaoTwd8BBYG+cn9d8ciEMg6HyF0Vf4S49k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7VG+JkleamDqvSOsyB/C2Z/ovjEQM6bB2s54AWhnnfUdKdqChUOARVySPv/1Z4kDtfI+BKh7DjY6QV2blZrV+/NW9WgtyPnI0yBzaIb5OoXYka/TDQLPpacaXaMm6oHxSoPc4HoQQVMiEnnjaF7bMis6URSgwEWEYBcwZaZg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Aug 30, 2024 at 01:06:00PM +0000, Benno Lossin wrote: > On 29.08.24 23:56, Danilo Krummrich wrote: > > On Thu, Aug 29, 2024 at 06:19:09PM +0000, Benno Lossin wrote: > >> On 16.08.24 02:10, Danilo Krummrich wrote: > >>> Add a kernel specific `Allocator` trait, that in contrast to the one in > >>> Rust's core library doesn't require unstable features and supports GFP > >>> flags. > >>> > >>> Subsequent patches add the following trait implementors: `Kmalloc`, > >>> `Vmalloc` and `KVmalloc`. > >>> > >>> Reviewed-by: Alice Ryhl > >>> Signed-off-by: Danilo Krummrich > >> > >> We discussed this in our weekly meeting (I think ~one week ago?). If you > >> give me a draft version of the comment that you plan to add regarding > >> the `old_layout` parameter, I can see if I am happy with it. If I am, I > >> would give you my RB. > > > > May I propose you let me know what you would like to see covered, rather than > > me trying to guess it. :-) > > I was hoping that we put that in our meeting notes, but I failed to find > them... I would put this in a normal comment, so it doesn't show up in the > documentation. Preface it like implementation decision/detail: > - Why do `Allocator::{realloc,free}` not have an `old_layout` parameter > like in the stdlib? (the reasons you had for that decision, like we > don't need it etc.) Ok. > - Then something along the lines of "Note that no technical reason is > listed above, so if you need/want to implement an allocator taking > advantage of that, you can change it" I don't really want to set the conditions for this to change in the documentation. It really depends on whether it's actually needed or the advantage of having it is huge enough to leave the core kernel allocators with unused arguments. This can really only be properly evaluated case by case in a discussion. > > I don't think we need a lot here. Additionally it would be very useful > to also put this in an issue to not lose track of it. > > --- > Cheers, > Benno >