From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender5-op-o11.zoho.com (sender5-op-o11.zoho.com [165.173.182.11]) (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 4D3FB4A6CF3; Thu, 3 Sep 2026 13:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788441072; cv=pass; b=lYjQUQmXfofqEGMIzoXcAMvH2qWm8XVZIGQzHOT5F+C8361iO6xe02AUyCgl69tDOekDUsXs3qvZm9RHGSpcSSXBwxV8qS8a7p3rOmVv5NEq5dRqcFEWYYFaq5kBCXCqH/JreyRhdJ45AYPJmcM/Xh6roGKkDGxwN/GpNgfi+4g= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788441072; c=relaxed/simple; bh=0pjjA4DZdsvZ1F6GbPmSRh4Ktd2FVnk3lLk3dtHnCPY=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=aklZU2Cjvdg0Lxd0AhI/VGxTsMkUTL0cuYAOhvaRyBcFFknGjyCNSypYWksgdNaVJgqYWxe6sueMzsFbClK2Kpv3FoB+CxycV0L42+diaNjUyEjyVYBq9hVqCoXJUoBAUM3t2ptlzbf/7iNrGUomoKie3o2EbETdhThYDe5lvVM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=daniel.almeida@collabora.com header.b=ZiQX6yMA; arc=pass smtp.client-ip=165.173.182.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=daniel.almeida@collabora.com header.b="ZiQX6yMA" ARC-Seal: i=1; a=rsa-sha256; t=1788440987; cv=none; d=zohomail.com; s=zohoarc; b=fuKgUs9b7JuOO7CEi3lcRc5gF6oqDW0UIPI4gapgwybnAgyJZia5P1bWcOitvwlihCpvmOYU/zxyOepuKq7jw/BpU9Wkj7NI3j+b7MrWtoCHX9GD72fwsWEvR3hLmwZ2xe3kn4x9YNFep4/8Q2jC83BXykndAIFKhKDkQhHGSwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788440987; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=20L8H017f+X+nMpU/Ghy+Mvvvk1JGSQ75hVtn1pe7RI=; b=blRLJLlkqMO9bRBVDrRu3eQhuoqGkilCKfYkRSPyoK9zPCDfbik0Sg7z0k+Vu+EFc9tfLZkRSd/q+Owd+fakraBfrWmlaU2TjPutjKcXvLz7hWCS04StbSHVm1tT+JB7CoTfkg673ORXJgUeTHIxnVPkZWPMsAJnIKpaKwbTtBw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=daniel.almeida@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1788440987; s=zohomail; d=collabora.com; i=daniel.almeida@collabora.com; h=Content-Type:Mime-Version:Subject:Subject:From:From:In-Reply-To:Date:Date:Cc:Cc:Content-Transfer-Encoding:Message-Id:Message-Id:To:To:Reply-To; bh=20L8H017f+X+nMpU/Ghy+Mvvvk1JGSQ75hVtn1pe7RI=; b=ZiQX6yMACMu5Ymav6Tus7unvzhLHvJrc+PvXBSEeomEdR7IwoWypoXlaENBHUCYs QuvvoqfWauBzNFhWj4NoosOPHQ5/0Zefk0YLOZpIbeyfmqaYDn0cmmYhN9CTWW1abD1 I917eV/xaDVUIxBBvh8GxIsGd6YpB7KPt5lkJuSQ= Received: by mx.zohomail.com with SMTPS id 1788440984549371.17029183808177; Thu, 3 Sep 2026 06:09:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH 2/9] rust: mm: add `task_size` helper From: Daniel Almeida In-Reply-To: <20260902-tyr-ioctls-v1-2-e0fdbf8bd108@kylinos.cn> Date: Thu, 3 Sep 2026 10:09:26 -0300 Cc: rust-for-linux@vger.kernel.org, Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Tamir Duberstein , Alexandre Courbot , =?utf-8?Q?Onur_=C3=96zkan?= , Lorenzo Stoakes , "Liam R. Howlett" , Lyude Paul , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, Alvin Sun Content-Transfer-Encoding: quoted-printable Message-Id: References: <20260902-tyr-ioctls-v1-0-e0fdbf8bd108@kylinos.cn> <20260902-tyr-ioctls-v1-2-e0fdbf8bd108@kylinos.cn> To: sunke@kylinos.cn X-Mailer: Apple Mail (2.3826.700.81) X-ZohoMailClient: External > On 1 Sep 2026, at 13:09, Ke Sun via B4 Relay = wrote: >=20 > From: Alvin Sun >=20 > Expose the task's address space size. It is used by the Tyr driver > for splitting a VM's GPU address space into user and kernel regions. >=20 > Signed-off-by: Alvin Sun > --- > rust/kernel/mm.rs | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/rust/kernel/mm.rs b/rust/kernel/mm.rs > index 4764d7b68f2a7..d2dfbb7d43972 100644 > --- a/rust/kernel/mm.rs > +++ b/rust/kernel/mm.rs > @@ -149,6 +149,13 @@ pub fn mmget_not_zero(&self) -> = Option> { > None > } > } > + > + /// The size of the process virtual address space. > + #[inline] > + pub fn task_size(&self) -> usize { > + // SAFETY: `self.as_raw()` is a valid pointer to an = `mm_struct` per the type invariants. > + unsafe { (*self.as_raw()).__bindgen_anon_1.task_size } > + } > } >=20 > // These methods require `mm_users` to be non-zero. >=20 > --=20 > 2.43.0 >=20 >=20 Reviewed-by: Daniel Almeida =