From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012065.outbound.protection.outlook.com [52.101.53.65]) (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 9488B37BE9A; Wed, 8 Apr 2026 13:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.65 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775654801; cv=fail; b=K+h7zwC1dBsaqc3b1sElWDPzSb1UJZibX+TtgGSBj05uKdt4tPJs6/M2GZbGJqP/xzyild3Eeuzh92FGBgKP4uuvkHRl+QKHiq3tQdcGTSYmaIQp4pHrcmKvUFVMspFVfvHupHjvST1Q2a1WAtqIUN2O4pgTphpdJYofiH+4HGo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775654801; c=relaxed/simple; bh=wteaW0rHFtaLDVSr6BlOgIq3vA6mKOP4KakzQCOqt04=; h=Content-Type:Date:Message-Id:From:To:Cc:Subject:References: In-Reply-To:MIME-Version; b=oEZ+5eiyPacjh6xFG6/whmZxtWUfTC6Xoy8Nb2RZZKPDaaHr7If8PW3QyMUOv9S0h/Ltx9LUHuxpBxspk0//5HK6a9iA/q2QtnwY+ikIdcUtH/VxMq3Ru6qC77L68G8n/v7eoSLG/GqL9aHMwwEuRAk0wS+3+VWorIy59kiZa6A= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=qtcIiZV6; arc=fail smtp.client-ip=52.101.53.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qtcIiZV6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g0RKo1usvZAy8gjh5MYiKCdKMT5CTb/PzAzjlJsZ2axK7Jrm5ytE6pvBHAgs3IC2RGl/JzKlg3v6qKmxr7tFobQjP+TS9Hoq6pLrCkw+kE47FfgUFomgf6I8CtGyKxH2g+/fWK594gmKRUdpIszlkBzNOyLyj/9ybgefACsYpgvdG4El7WpYMdhgdpUNmJbqo5isC+sZZhI4XzC328P6qRZZUMzV2D0sZMNz2IpHWc7HUHHarLmrfnm6qQubxeB3HnKvmtncwFdVqOxwxTxkbDzxWuzCeDIekD6idkkig3uK3213GJmHtC1+q9QhayZEMkaJexi+/xvRhcS3BU13eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+0WKHuaMbQSnrk7PbUjQvaDW9gAo22uZOHqMyCYbf5Q=; b=SGRY5FW3xVYA3PkMYp7r54pZNWvqOKB+OLYB0sy+3A+UGt0QOjQ/aaMaed/WTnRXV+ciW4Pg+yEPB/gdGgIMulNC/DXC/4Ry4sfj1t1Fq9kVSVhppbZ+J2Y0IKZq5OFJ57u2nHI8YDpwzA3eV9NfXgVT646vtgk3EzVS1J4BHDxRzWCb+o2y0VTD4MCpGUP/t++3it5KaLmBG78Pfmv4Be0nE/EuCV7Y0Bhq5UNZJn7MNb9GZ7AzIQsfw8oYc3s6RP9JnjA+IjyTvqYmUKZVMHb8zE0jDUx759fQD0i9mu6VrmmusDoxzqu9hS7PZ+zlXddLSBXXUQeSoNgjodUmnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+0WKHuaMbQSnrk7PbUjQvaDW9gAo22uZOHqMyCYbf5Q=; b=qtcIiZV6glsV01tSAVThLENvtPKwC/LgKAwaNVZqrsRakD/y/yGtBDg1CfCRTZnpeaYPUzyImmCGpdmuUjsCvVW/PegFMPemz1yak028SfRGTug6Dljr0TM0lurtSb7BaGRpXe1muTnnRuo5VEVEcTlZLFf3mCKmzL4eQkG38FvY+E1VHtGFhWdVaAfV+gX/QS2y1mZUaVGAHIPi9l5+uiKFxMqK/+S8+hZFUY9cO4FK4rOoGcM/MliKGNxhaaIHN1XMIekirxLOgxrgSOueKf6OfS6O39c37OXOS3IMt3y0mL1prYaidBkdwgi/gOOTnWSDBqzq6Mpo1XGPARvETg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) by DS7PR12MB5910.namprd12.prod.outlook.com (2603:10b6:8:7b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Wed, 8 Apr 2026 13:26:19 +0000 Received: from BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0]) by BL0PR12MB2353.namprd12.prod.outlook.com ([fe80::99b:dcff:8d6d:78e0%4]) with mapi id 15.20.9769.017; Wed, 8 Apr 2026 13:26:19 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 08 Apr 2026 22:26:14 +0900 Message-Id: From: "Eliot Courtney" To: "Joel Fernandes" , "Eliot Courtney" , Cc: "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , "Bjorn Roy Baron" , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Dave Airlie" , "Daniel Almeida" , "Koen Koning" , , , "Nikola Djukic" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Jonathan Corbet" , "Alex Deucher" , "Christian Koenig" , "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "Tvrtko Ursulin" , "Huang Rui" , "Matthew Auld" , "Matthew Brost" , "Lucas De Marchi" , "Thomas Hellstrom" , "Helge Deller" , "Alex Gaynor" , "Boqun Feng" , "John Hubbard" , "Alistair Popple" , "Timur Tabi" , "Edwin Peer" , "Alexandre Courbot" , "Andrea Righi" , "Andy Ritger" , "Zhi Wang" , "Balbir Singh" , "Philipp Stanner" , "Elle Rhumsaa" , , , , , , , Subject: Re: [PATCH v10 12/21] gpu: nova-core: mm: Add unified page table entry wrapper enums X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260311004008.2208806-1-joelagnelf@nvidia.com> <20260331212048.2229260-1-joelagnelf@nvidia.com> <20260331212048.2229260-13-joelagnelf@nvidia.com> <5db2aab1-4b65-486e-ad9b-27a108bdb0d6@nvidia.com> <537a8c5a-3885-4c47-99f6-963b48ddf87d@nvidia.com> In-Reply-To: <537a8c5a-3885-4c47-99f6-963b48ddf87d@nvidia.com> X-ClientProxiedBy: TYWP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::23) To BL0PR12MB2353.namprd12.prod.outlook.com (2603:10b6:207:4c::31) Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB2353:EE_|DS7PR12MB5910:EE_ X-MS-Office365-Filtering-Correlation-Id: a307159d-a2af-4f98-e767-08de95726ac7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|10070799003|7416014|1800799024|376014|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: QBn4jI1BV9swudwY4bktpxr6E3NarbaRuzTJrZgslkHgBN0dM8IIkR1KNRJLhJe864XrodNWiwRK1/vKec8QymNdimEbzOuYBCHyOwHhPcMTnIultc6/HbfZ/8MRtUuh5rftOAv4ZNAk6/35VcWJ3PWBn/YFuKOcwg5Hhi2Bf5sRHf6zH+VOSB1XQMYMqjlyfTReZHD+6GxWGK3r/Yv5Brn+Mqqlo4FQeZBDlA5aFITr6mRrnU1QAgBz2TlIt2YTbJADOKu3mOx4BPb7mW7O0EKf/Byhc0cjX8vDcCoGN4vKmwvO38bGjvK3KPa5WpHiMOqQRZ79GrEicjUyNWnOzh/bArUgWwGxzwgGM3nvX41znLDiC0R6cZvHqMOgCpqBMLpYUwnuB1YISTrpPSPzrwWoTKv/pi03T4+ZKlT2GZE5TWYatloj4DEndlsILyl+kFiI+E1MvnNJXvraI/raF4+0KzkkSY+evbiQgJDOMkpXhvxdbfhnp64btcAb4U+HSZS9IMz1c+OjNeigHR/2QbIET6lLbDuJqHVCFkAGB7mwBuFK9fOBqjwMEOhjl/A42ndJCCm88BG+D+BI7wYJfXmWAO9ueWurvtZSv5Ph1QrbrU2Iag08CotTCyKT+4byGIu5G+z1rg/Vgy6KJ9rTWFv/BXKTiXYYz0LcMJwVktTL0GPtPFA89zFTMZ6M7RRCLXZJc28RtBX4hwqEt1X+5mjrPl9ZCG4tWOLVcg/0PoI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2353.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(10070799003)(7416014)(1800799024)(376014)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exch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XUFh1QWN1?= =?utf-8?B?bXNXcW5oV292MXYvMWp1c3RjLytCcDluRnpGMDdzZDkxNmx6ZmxkSEJ6YzY0?= =?utf-8?B?K3lZN2xObkkwb3E1NXp1aE82ZVdxSXJMZ0c0UUJhZEQ3R3FtUjh6YjdkOHRv?= =?utf-8?B?a3oxMzFQR3VXVVRFS0FYaTVZVUt3TS9yRld4cEhjMEp6dTY1REgxd2RkR1Z4?= =?utf-8?B?R3p6YlB1N1JwbFM1Q1BobFpkU0RHMFU5SVBsc29qZUtkRXMvajEwdkptV3k0?= =?utf-8?B?dnJIQXNDOGh3Qk9nNGdYd3Yxc0pmNWF0MWF1RkM0MG1OWm5CYXNVVHB0bDZ0?= =?utf-8?B?N3NHWWp6d2k3UTdvcWlLN1k1ZEovWUJDVisxVXF2TFlOTk14elEzTDlQaG01?= =?utf-8?B?aC9zUlNVS25HUkQvWHVBY2NXb0d6TVplcDl2RERmRDdGNk9VY3VCTFcwc2JM?= =?utf-8?B?dCsvMi91OXByUm1aRjBBemY3QmF3aDM5aVdSazN6bytOVGxXd0N0T2pmUEkw?= =?utf-8?B?Vk11c1JTQVZzdDFVOHhXdmdqRkJ5eU1JcHFZVGNnN1BidU0wZVNIQkhFSTQr?= =?utf-8?B?bmFoNzQxTk1nNlNuOXdEalJWcjJtQ25UOHhkRnFaMnFDa1JjQXJTSi8ybFFV?= =?utf-8?Q?E29F/BVXf4npUDGswHQD8xrQTin0BY+RdWUUmmPY0pasN?= X-MS-Exchange-AntiSpam-MessageData-1: esiJ5NSsLWqf1w== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a307159d-a2af-4f98-e767-08de95726ac7 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2353.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2026 13:26:18.7623 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AU/YkZwBwnpcXWsTJxhGdIW8lOrl4UcFDzC3PpZp1AkIPNRGgVukaA+ab+DCfnXJ5Bft0AD9wl2ElEH76oSu8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5910 On Tue Apr 7, 2026 at 10:59 PM JST, Joel Fernandes wrote: > Hi Eliot, > > On 4/7/2026 9:42 AM, Eliot Courtney wrote: >> On Tue Apr 7, 2026 at 6:55 AM JST, Joel Fernandes wrote: >>>>> + /// Compute upper bound on page table pages needed for `num_virt= _pages`. >>>>> + /// >>>>> + /// Walks from PTE level up through PDE levels, accumulating the= tree. >>>>> + pub(crate) fn pt_pages_upper_bound(&self, num_virt_pages: usize)= -> usize { >>>>> + let mut total =3D 0; >>>>> + >>>>> + // PTE pages at the leaf level. >>>>> + let pte_epp =3D self.entries_per_page(self.pte_level()); >>>>> + let mut pages_at_level =3D num_virt_pages.div_ceil(pte_epp); >>>>> + total +=3D pages_at_level; >>>>> + >>>>> + // Walk PDE levels bottom-up (reverse of pde_levels()). >>>>> + for &level in self.pde_levels().iter().rev() { >>>>> + let epp =3D self.entries_per_page(level); >>>>> + >>>>> + // How many pages at this level do we need to point to >>>>> + // the previous pages_at_level? >>>>> + pages_at_level =3D pages_at_level.div_ceil(epp); >>>>> + total +=3D pages_at_level; >>>>> + } >>>>> + >>>>> + total >>>>> + } >>>>> +} >>>>> + >>>> >>>> We have a lot of matches on the MMU version here (and below in Pte, Pd= e, >>>> DualPde). What about making MmuVersion into a trait (e.g. Mmu) with >>>> associated types for Pte, Pde, DualPde which can implement traits >>>> defining their common operations too? >>> >>> I coded this up and it did not look pretty, there's not much LOC saving= s and the >>> code becomes harder to read because of parametrization of several funct= ions. Also: >>=20 >> Thanks for looking into it. Sorry to be a bother, but would you have a >> branch around with the code? I'm curious what didn't look good about it. > > Sorry but I already mentioned that above, the parameterizing of dozens of > function call sites, 3-4 new traits (because each struct like > Pte/Pde/DualPde etc each need their own trait which different MMU version= s > implement) etc. The code because hard to read and readability is the top > critical criteria for me - I am personally strictly against "Lets use shi= ny > features in language at the cost of making code unreadable". Because that > translates into bugs and nightmare for maintainability. > > I don't have the code at the moment, but if you still want to spend on ti= me > on this direction, feel free to share a tree. I am happy to take a look. I had a go at this, you can see the branch here [1] - it might not be perfect, but I think the shape is directionally good. It's structured so the HEAD commit has the diff from the current approach to the parametrised approach. The main decision is where to do the type erasure, I chose in `Vmm` since it looks like the main top level API for this code, but could do `BarUser` instead. I think it's overall better. I also think Alex's point about associated types making it easier to use the appropriate Bounded type is a good one. [1]: https://github.com/Edgeworth/linux/commits/review/nova-mm-v10/ >>>> Then you can parameterise Vmm/PtWalk on this type. >>> >>> The match still to be done somewhere, so you end up matching on chipset= to call >>> the correct parametrized functions versus just passing in the parameter= or >>> chipset down, in some cases. >>> >>> For now I am inclined to leave it as is. Also there's a Rust pitfall we= all >>> learnt during the turing and other patch reviews, sometimes doing a bun= ch of >>> matches is good especially if the number of variants are expected to be= fixed >>> (in the mm case, version 2 and version 3). Traits have some disadvantag= es too, >>> example dyn traits have to heap-allocated, parametrizing can increase c= ode size >>> (due to monomorphization) etc. >>=20 >> Yeah, it's just this is a lot of matches in a lot of places. And we have >> ver2 / ver3 specific code leaking into the general pagetable.rs file. So > > That's not a leak, that's by design. pagetable.rs is where the matches ar= e > centralized, most of the code changes here on out should happen outside o= f > this file. > > 31 out of 42 matches in the mm code are in pagetable.rs, so it is already > centralized. > >> it would be really nice if we could find a way to improve this specific >> aspect. We can reduce the match to happening in just one file.=20 > > Assuming we know what we're improving. ;-) > >> You can> avoid heap allocation if you would like by making Vmm an enum, >> for example, and doing the match based dispatch there at the top of the >> API tree, rather than at the bottom where it fans out into a lot more >> locations. > > heap allocation is not always free, this code sensitive to dynamic > allocations in the kernel, due to MM reclaim and locking. I would like to > keep it simple. If you do the type erasure via enum in Vmm, you won't need to allocate it on the heap. The branch I posted above has an example on how to do this, although there might be a better way. > > thanks, > > -- > Joel Fernandes