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 0C1EAEDE9AD for ; Tue, 10 Sep 2024 19:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9AFC58D00B0; Tue, 10 Sep 2024 15:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95E898D0002; Tue, 10 Sep 2024 15:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 826118D00B0; Tue, 10 Sep 2024 15:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 63A028D0002 for ; Tue, 10 Sep 2024 15:37:35 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0F01BC0AB6 for ; Tue, 10 Sep 2024 19:37:35 +0000 (UTC) X-FDA: 82549838070.21.62B0595 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by imf05.hostedemail.com (Postfix) with ESMTP id 09CDA100005 for ; Tue, 10 Sep 2024 19:37:32 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=proton.me header.s=protonmail header.b=EJeq2aYk; dmarc=pass (policy=quarantine) header.from=proton.me; spf=pass (imf05.hostedemail.com: domain of benno.lossin@proton.me designates 185.70.40.133 as permitted sender) smtp.mailfrom=benno.lossin@proton.me ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725997025; a=rsa-sha256; cv=none; b=fuD0gXh4WiAUbMZOX+bNhg0fObtLRVVUftLqW4yNzP7/VqO1zEbwbmy4C+o2Ax1F1XTAZe ro7460lnALx250yGbVhXxEb1Qyln0M6TZlYJ0cYGKL6TJgChhDhnKaCT7PhhO2r4bm4/l0 t775Ip+ZruERknfL5FDUl6FVv1N0qRs= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=proton.me header.s=protonmail header.b=EJeq2aYk; dmarc=pass (policy=quarantine) header.from=proton.me; spf=pass (imf05.hostedemail.com: domain of benno.lossin@proton.me designates 185.70.40.133 as permitted sender) smtp.mailfrom=benno.lossin@proton.me ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725997025; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2vhIboT8ME/071QA9HFuaYGAReumSa+MmRICSuZMu6o=; b=TVs0yqxYwqn2FDWseSFK26WrgRO4Y1ZrI/KfcQKy6VEZ6miuWADZIPssvvePG/okkIK63e H4iWG3AQjsHs43Eq6HtrIT+dY+JxTtnkkx1/koMSd7U6BIdxcubliN7XMtioqI92Y1+i9C C5QTTuG+PuJ4z66qdcj9tLRA+MyG148= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1725997051; x=1726256251; bh=2vhIboT8ME/071QA9HFuaYGAReumSa+MmRICSuZMu6o=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EJeq2aYkTtSxcaKY09Y/x+THrtwR0fMeOOfR3rqtjwDzx8AFbiodhNJkuBX8WygaA KoGbjoQoWcAwkENMBMqyWqUT4lSALm2DIfLgdTnHt7rhuuy48PH1UV/51WEk2Yk4of tD0Ccc8vU8x9cAaKrHLGJmguBv1N6KVcL5DEJ7T/NzPsxtT6K8yjEboA7c3P9MU975 mapkFILrtOPjKGCoLkj7Brh8SgmnI+IIyJfvEoYc/puiPHOXA61CVxFmL9KuYDM3+z rc/yksqXXv8MASpnbo2Yo3M5eix0RMqCwenpTgdBoTj9GwlZzzwHEiIinnoOxi/nD3 2aF4ytiiwpEeQ== Date: Tue, 10 Sep 2024 19:37:24 +0000 To: Danilo Krummrich From: 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: <3309d946-c513-4c0b-baf4-d65cba04832a@proton.me> In-Reply-To: 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> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 3f2cbc8058bb0b3e4f0868a85c58b7d733780848 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: 09CDA100005 X-Rspamd-Server: rspam01 X-Stat-Signature: 8j6xtwzffes9m6oahn4b75tzx9ktapm6 X-HE-Tag: 1725997052-179455 X-HE-Meta: U2FsdGVkX1+esB7yqRZU8KQuqI7K2xwQEADdfeRGlS94rn2OUsuoHXkraPbMeuw3Qh6BqEnoLcgJ7ohMBrxkSKArwjqvJAMNgDGh3XdP10EWqtDLx9IRJMYwppaHBZt3Wdft2hAcPdp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Us8dFuWpXiTmK2NMZgANjmtGsTErZutql5p7xFJwk9IPSkkAWbh1920oQv0eZY9luckg3koE/QYnB7oEgwj0uz+r5sH1Yk5pmBENm1SrrqGvnJmH7HY3nYyChqRX04E8Co+C5YzYZA/rFA2pRUFsTcBNJE86lP2Pa1fLhGym8k26bLKBgipYsj4P17hC6vPxfTz5T5wWhH38g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, 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 10.09.24 15:23, Danilo Krummrich wrote: > On Tue, Sep 10, 2024 at 01:03:48PM +0000, Benno Lossin wrote: >> On 03.09.24 13:56, Danilo Krummrich wrote: >>> 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 on= e 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 regardin= g >>>>>> 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, rat= her than >>>>> me trying to guess it. :-) >>>> >>>> I was hoping that we put that in our meeting notes, but I failed to fi= nd >>>> 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` paramete= r >>>> 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 allocato= rs with >>> unused arguments. >>> >>> This can really only be properly evaluated case by case in a discussion= . >> >> Agreed, but I don't want people to think that we have a reason against >> doing it in the future. Do you have an idea how to convey this? >=20 > I understand (and agree with) your intention. But I don't think it's nece= ssary > to document, because, ideally, this is already true for the whole kernel. >=20 > Generally, I think it's valid to assume that people are willing to change= the > code if the advantages outweigh the disadvantages. Sure, but for certain areas you might need a very, very good reason to do so. In this case, I fear that people might believe that this is the case, even though it isn't (one of course still needs a good reason). > So, we could write something like "This may be changed if the advantages > outweigh the disadvantages.", but it'd be a bit random, since we could pr= obably > sprinkle this everywhere. Sure, that works for me. I don't think that we can sprinkle this everywhere (but of course a in lot of places). --- Cheers, Benno