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 1E1E1C8303C for ; Tue, 8 Jul 2025 14:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B28EB6B02AD; Tue, 8 Jul 2025 10:16:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADA4C6B02ED; Tue, 8 Jul 2025 10:16:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A16C46B02EE; Tue, 8 Jul 2025 10:16:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 901BA6B02AD for ; Tue, 8 Jul 2025 10:16:55 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4E00DC064D for ; Tue, 8 Jul 2025 14:16:55 +0000 (UTC) X-FDA: 83641298790.07.E3BD9E3 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf29.hostedemail.com (Postfix) with ESMTP id 9F83E120007 for ; Tue, 8 Jul 2025 14:16:53 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="KLsIDOX/"; spf=pass (imf29.hostedemail.com: domain of dakr@kernel.org designates 172.105.4.254 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=1751984213; 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=7Mw+PZ5Im+Nyc+Q6yUBwtjjbrSzXxctrTS1Xq0gG+cs=; b=pUNirJyfum2tLC9XmWjoldNHQBcqiwHUcxohPseKIJdVpvbuk8GqO2Cgzcba2NllXmLAva F8qLLqp8d/ZUSxtfJxmn1BfURS7uZkFkpStOeBZrwece5MGVkASAG1W1l6JWG3UPrOMiJU Xb76RWEGG7vmlKzK5fxjjMKRcrb3mSk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751984213; a=rsa-sha256; cv=none; b=FZ9f+1nLW7H9XcpdgZKmU9h4wQ1WlKbAbh7oYRCMR2MGXf5DiokE55PExHGBoOTF0MWIqC jOTtlYBSlHhCa/OItXxliAAo6E3VJECoGARO65EUdAmotdgWSpawuq6xV8d+ymj/7Etdyd vt2ON6rKA0E0sOj1R5NAPps1Ehg2H4s= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="KLsIDOX/"; spf=pass (imf29.hostedemail.com: domain of dakr@kernel.org designates 172.105.4.254 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 tor.source.kernel.org (Postfix) with ESMTP id E46D0613AD; Tue, 8 Jul 2025 14:16:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D93C4CEED; Tue, 8 Jul 2025 14:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751984212; bh=HVdq9Ob+LWkVTvYMozCbo8YOzRFhxR/8PVag/iaD52Y=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=KLsIDOX/gO9gG5yNmE+GW0qVHE/PNhaZHFFwlrCyDDCFkutAzCkrzOykvoHW3463T 0NO9tgXfSPuECNSQ2RX6wZEtw/YNP0eGdP3ZHy7hFFgjuAQ0JntIcs3Bays0bsEmRk Q/OP9PCQXMyudlDjCZo3dPudakfShLV24LYYKScir4ftFY1XBoNEWlOeE/x8kH3Qkq fTESNZ+SwKP8Hz/z4t1+tzI/r7Vr0PihIIPl+I1Gx7kRihMnwGFW9Axt1/7ZpKJXY+ QnXQuX44/xMRwhQlenMpyWOus49Arjo+bNLe80idPHPu8d+jT7HYVRHeGaInSgjGFt eet+zAlI36iGQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 08 Jul 2025 16:16:48 +0200 Message-Id: Subject: Re: [PATCH v11 0/4] support large align and nid in Rust allocators Cc: "Vitaly Wool" , , , , "Uladzislau Rezki" , "Alice Ryhl" , "Vlastimil Babka" , , "Liam Howlett" To: "Lorenzo Stoakes" From: "Danilo Krummrich" References: <20250707164755.631374-1-vitaly.wool@konsulko.se> <824065ea-1f5c-4cd4-9917-4b7a91882af8@lucifer.local> <54fc10ce-c3b6-4571-93e7-eebfc538d0c7@lucifer.local> In-Reply-To: <54fc10ce-c3b6-4571-93e7-eebfc538d0c7@lucifer.local> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 9F83E120007 X-Stat-Signature: 5uor56gbzrsi4oomroymksz9c7k5wscw X-HE-Tag: 1751984213-820002 X-HE-Meta: U2FsdGVkX1/nZDYe40zVstDLj+j103z0+1vzYOIpbfChdQLIjbn+wk2r0/yUnLgHV27R9/xOKpXCnGDJXrYUfY2DUCqdbbap5zt9bJXVveIx7wJ2ebrJGU8rOsJfdkzgQMIzaOJgsna36l1NQdqsJqUjGWEAgUKX3FNNy6Z6kr30V9jZrSIjnEqegYpE8769LQVoqPFMm+Jyp0NijRdSA74zvQOOU1pXsZfnQYSCgOEguEq9DAsmJVBCCHjQdGdmKb1qN+wcKIVRCXrCR1QD7p/NDa4nX/3e2621ll7kDvwXqIEeS6tOxoUXw3BEIeEeKF5ySGgq7Vxc4mHmThG4sZygkczFX17Dan2hS2694upKoam3+KoOhRV8zSW+bigtzWxwc2bkBfHZ/6cVN2aahiNKDuvve4D1prU/yC04pZPiVckcIPSYUzl8fsSR0Pga1/dw2trgng91B+8eb1EUuzumKS6jzntvrvIXA7lHr3cj5WI5NkQbbSV/FeH2LKFLbHvcKZuhKZwSAbtSXELzadkzlwCtESOq/Cyk/xmtlQ2qCibmsFEivKasHn6DWnQBPx1gKRF2R8lG6/QfWLy2zRdNlk1fMCSajho9LebyPuKZh1rXyAtEe0H36jzp9NAJ1lvUVe6RKI4ot3EFPwQVOeoxsK6rlBNsko+4ro3Pxu45KbqytbHtIN4FIYlLmEO39fhr/ktVoPIhX6MvKWsZcTEr5HSmovWsLapkRks3hB2s59wavOma/HtEvB9tyBX6GO8xSeN5M9oF25gkcpGp3WoRZnehaTvihdL3kWxgm7Zisdo/3bpprVNdq8jLybcxD8ybxHrQ+pwQWXM81vJ4l9yEZ+1ObahDeG3MjvvSdq4fDB2djF8bLufMZIciaftkGMiEgJ3Av726FW0cxTtZSrzyyRp6AkzDBDPgnvDPkkOze6jqQBuKplC4009zHLKpJu0H2wwjsHCuUNsjmRd vEHScyMk U8WN8PknIQzNoAoalEfUEI9xlUc5leS53RxawoaZIcOxx1vX5JsAkA28womEqLI4UQ25fECn6yspcfFyURQNBx+nHaxuj1LY54B730aRvbwa5bbSkKD7bLQlwsftPLJlKlPnVv8EU8WKbZ0ifqs/8H38WqGQZfHyDoJRL/9x/hIBuRSKdKiJ9SfPEAWfaYaaUO5IKe/IcVIqBDvzADN00IIPDkxeMOPP1o1SMJm4ieK6yQh9kPZjzFuXpn8cg2/jktc3U1JyCTFvq34+UuvSBg0rAKOX/XkypAIUqjaihlnZvDlg= 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 Tue Jul 8, 2025 at 3:19 PM CEST, Lorenzo Stoakes wrote: > On Tue, Jul 08, 2025 at 01:55:18PM +0200, Danilo Krummrich wrote: >> On Tue, Jul 08, 2025 at 11:58:06AM +0100, Lorenzo Stoakes wrote: >> > +cc Liam >> > >> > Hi guys, >> > >> > We have a section in MAINTAINERS for mm rust (MEMORY MANAGEMENT - RUST= ), so >> > it's slightly concerning to find a series (at v11!) like this that cha= nges >> > mm-related stuff and it involves files not listed there and nobody bot= hered >> > to cc- the people listed there. >> >> What files are you referring to? Are you referring to: >> >> rust/kernel/alloc.rs >> rust/kernel/alloc/* >> >> If so, they're indeed not under the "MEMORY MANAGEMENT - RUST" entry, wh= ich >> so far seems correct. > > Looking at these, they seem to be intended to be the primary means by whi= ch > slab/vmalloc allocations will be managed in rust kernel code correct? > > There's also stuff relating to NUMA etc. > > I really do wonder where the line between this and the mm stuff is. Becau= se > if the idea is 'well this is just a wrapper around slab/vmalloc' surely t= he > same can be said of what's in rust/kernel/mm.rs re: VMAs? > > So if this is the rust equivalent of include/linux/slab.h and mm/slub.c > then that does seem to me to suggest this should be considered an mm/rust > thing right? > > It'd be good to know exactly what is considered mm rust and should go > through the mm tree and what isn't. (Please also see the explanation in [1].) There's a thin abstraction layer for allocators in Rust, represented by the kernel's Allocator trait [2] (which has a few differences to the Allocator = trait in upstream Rust, which, for instance, can't deal with GFP flags). This allocator trait is implemented by three backends, one for each of krealloc(), vrealloc() and kvrealloc() [3]. Otherwise, the alloc module implements Rust's core allocation primitives Bo= x and Vec, which each of them have a type alias for allocator backends. For insta= nce, there is KBox, VBox and KVBox [4]. This was also mentioned in the mm rework in [5] and in the subsequent patch series reworking the Rust allocator module [6]. Before [6], the Rust allocator module only covered the kmalloc allocator (i= .e. krealloc()) and was maintained under the "RUST" entry. Since [6], this is maintained under the "RUST [ALLOC]" entry by me. Given that, there is a clear and documented responsibility, which also Andr= ew is aware of. To me the current setup looks reasonable, but feel free to take a look at t= he code and its relationship to mm and Rust core infrastructure and let me kno= w what you think -- I'm happy to discuss other proposals. [1] https://lore.kernel.org/all/aG0HJte0Xw55z_y4@pollux/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /rust/kernel/alloc.rs#n139 [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /rust/kernel/alloc/allocator.rs#n130 [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /rust/kernel/alloc/kbox.rs [5] https://lore.kernel.org/all/20240722163111.4766-1-dakr@kernel.org/ [6] https://lore.kernel.org/all/20241004154149.93856-1-dakr@kernel.org/