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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CA03CD13CF for ; Wed, 12 Nov 2025 12:50:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D84E58E0006; Wed, 12 Nov 2025 07:50:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5CBC8E0003; Wed, 12 Nov 2025 07:50:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4BBE8E0006; Wed, 12 Nov 2025 07:50:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AEC138E0003 for ; Wed, 12 Nov 2025 07:50:53 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5E5EF592B0 for ; Wed, 12 Nov 2025 12:50:53 +0000 (UTC) X-FDA: 84101939586.10.968616C Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011065.outbound.protection.outlook.com [52.101.52.65]) by imf15.hostedemail.com (Postfix) with ESMTP id 75488A000D for ; Wed, 12 Nov 2025 12:50:50 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=Z7AprRyt; spf=pass (imf15.hostedemail.com: domain of Christian.Koenig@amd.com designates 52.101.52.65 as permitted sender) smtp.mailfrom=Christian.Koenig@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1762951850; 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=6pcK81sDiySzeK/tuQgk0eeeSiODaCg7Fico8bmbIJA=; b=IGOO8autJ5/bZc8BzpsQeVJgI5d/2Nx9j3O07INHPWuWfFjL61/5odM8lg9YigTyAZKWyY XNY2dsP3IF3Lm+6fJVVI6Nkr8OUuKR61oE2Ha+CWRTZNI9o/uWukWSDoga25c29ZMkBE+l ZAM548sR9p/Isdhv9LeUQWxC8MEdF6s= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=Z7AprRyt; spf=pass (imf15.hostedemail.com: domain of Christian.Koenig@amd.com designates 52.101.52.65 as permitted sender) smtp.mailfrom=Christian.Koenig@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1762951850; a=rsa-sha256; cv=pass; b=QXOXQ62WA3HDwL+CdppND+AL/R9FZNkGduyatdCI1QyUfti/p++hoLYGyAtdmkA1GjiDVU U6+DZLbqG9jI64yvZMOW96y8ho6W3qHrbgjcvVK+WbxNxmPo8Xls51lh+r3I3ie+iI+42d j/DZ3yg7VK9wvGfw3BlKjzELR+Z12Qs= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K9rmdnYL/uXeWFMlExwySTgw6eNKPY5cqZgKn3g94vdButQzTLR8s5cJI9QU65KoTbV8o9TxJXY6lDqfICjdlQcnR6GTwZeFznhn8WAWkbpHaD+MonFAsLS0qJJQElC7BbGQs31TGO3bu/Ooqq6+F8OelutO6fxlsEn6aMV9nELwJN2PWlfVmNka9P5oWVGEo7ZLtMCYRzGIjTJaIuROhwoUplKAG+/PJg515hDqAgE+0b+H3kieYZ+zUIL5JeQx+ZNj73vEd1wXArPVN/b0/jyVxqX9+BX0j58Ou4DrKcnROMnTk6Llrxx6hm1NGyL1GUmfEnG5g6aJ0gqIPSQuRQ== 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=6pcK81sDiySzeK/tuQgk0eeeSiODaCg7Fico8bmbIJA=; b=WmDBdJw03i1tmeJko7f2qFcg4wwV3zvwhZdcoBu5+3pWi7yx6gr13OARZhMaQ5BUmj/0wHAlEU6pG81i/NcrUtNwAJ+9JeRNUfoK+mG5X8p4eDX74z/ML/RI7ot6uFhxk17BO8fO2DLd/zeqUxmmHVMW3TflwKrTwCbeZhdN1Zxt5H6pW2uRNC2tYyQVlus7cDbihgKKhN+ETavi5M7M7N0JvK5Aeqx9B9dw1ufLL+vG2fF+6CekTygC5zMLd/W2kqWptM/uEgvKEO6RZu9r/5MttzLxIZqH22yMwL3kspMtG2u62yOIUhHDSWcgCstYnCjOstuqnrAvMyIWqyUfPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6pcK81sDiySzeK/tuQgk0eeeSiODaCg7Fico8bmbIJA=; b=Z7AprRytn5BALucJdkZBqWGMbw2WqCTi5iS89BJQ5rFGzeGeKWcaOBMPQtQIp+b5hm5DbVw9qnK77yXxngLkbQNStPZRwAblK0Xz4cu+1LIYfUkoPWtmcStaWBIlFbItCoo7j1KqyASH4F2AXTCz1ueuH205dBwUG7GkDNiZsT4= Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by DS7PR12MB9042.namprd12.prod.outlook.com (2603:10b6:8:ed::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.16; Wed, 12 Nov 2025 12:50:45 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::46fb:96f2:7667:7ca5]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::46fb:96f2:7667:7ca5%4]) with mapi id 15.20.9320.013; Wed, 12 Nov 2025 12:50:44 +0000 Message-ID: <5488f98e-4101-42c1-a0ff-0e0054e0e08c@amd.com> Date: Wed, 12 Nov 2025 13:50:39 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/5] drm/amdkfd: Add batch SVM range registration support To: "Honglei1.Huang@amd.com" Cc: Felix.Kuehling@amd.com, alexander.deucher@amd.com, Ray.Huang@amd.com, dmitry.osipenko@collabora.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, Honglei Huang References: <20251112072910.3716944-1-honglei1.huang@amd.com> <32a918b6-37bc-4d83-ae72-35010d4f1a8d@amd.com> <03b8be5c-64e0-4577-b4f0-0d505eff04bf@amd.com> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <03b8be5c-64e0-4577-b4f0-0d505eff04bf@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR4P281CA0036.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c7::9) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|DS7PR12MB9042:EE_ X-MS-Office365-Filtering-Correlation-Id: b3114d91-f2e6-42f6-13b9-08de21ea1829 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?QWZsRmhlc2F3VXZTcXJxMmg2ejFud0xweFpDN3lBUVFzRG1HeVJIejJPUnk5?= =?utf-8?B?bU1mOFNJUDNIS00ydnh2eTVqcFZwbFU1ZjFRWnl6dXVLTjZGTndxamcrZHJu?= =?utf-8?B?ZXJZYnMycHNKZ1FRU2I5bWJHREQ3R2dFSmtpeTZsV2hXOW5MaFlySnpaOTJE?= =?utf-8?B?Q3hnR1VYcERiVHpocXV4ZklTQ3B6eUFVczVjT0NsTkZReGt6VmpQb0VRQUEr?= =?utf-8?B?NDlNQmlXT1RGdnhkRGZkTVRmMDVaZXhjbnpCL281Q2lMWjZtd2xvWTQycUF3?= =?utf-8?B?T3ZhalpPbkdKbEYrUWdPc3p3Z25KQU0wTEs3Yi9CaUFQNkJZNE1leVNyTEN4?= =?utf-8?B?dlJIaG1RYk1paUc2d2tDUzFjS21JNXZrcUJFSzY0TDZQUUUrUkRVcysrZWh6?= =?utf-8?B?bit2TzZjMmFLdVVPWkpOU3BLelRKU05lUUtIQUcxWmdEZWNQUk4yanI1RFpu?= =?utf-8?B?ZUQ5TEhkeEVKZ2c4RXVBSTNBOXRHWDJ5dXpheDVWR2Z4U244VHQ0emdCeUlj?= =?utf-8?B?VlIwU3ViTDJ6Wnc4WEhGZlZpMWZZWE9ITmRIWFdUYXZKQkxoZkZtVWFKdjA4?= =?utf-8?B?aCt0Y1BzdklnQ3BabWJ4OHk5d011b1l5Tk1STGUyS1RLZnJxZWV6Yk5yOXRY?= =?utf-8?B?MnVBdXgvSnRsd25pbFAweGVKUlB1cGM0dmpadUdBMDNpcHFHaGo2aThxWDBW?= =?utf-8?B?MDhUdXN6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hhSTVxek5nTFgzMUYxNXJIUnNjV3crOEpqb0JUNFByOVk3Zlh3R1dUaGFw?= =?utf-8?B?ZzhEUzRjTnp1Q21GQ3crNjBFVVh0OVIwMkNGb0IvZk1rRmpiTkUwRDN4RkN1?= =?utf-8?B?UysyZG9XaU9NNHhGbUN2NmQwbE93Qi9zZE14SlBuc1kxWWxNSWtlUGhtalhv?= =?utf-8?B?NE1kaHRRUUdaU2FsYVNseEZ6VFdRR1A5N1kyck5MNXU2N3BWN3MvZi9SWVBh?= =?utf-8?B?REhpT3o3N2tJR1dlcE9lQTUyK0pYTVd1eHhFOHZ0RjhrRlRNVnp5NlIxbW1V?= =?utf-8?B?OFYwclVWVW9LeERKM1Ezb2g5NEJCQXA2WXdjTm5ETWR2QngwNnBwTG9TL1Fp?= =?utf-8?B?aW1rUUQ5RnRBPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TXMwbVVGQk1iZUhJdytmZjVLUzVaemMwTloreUR4WjhlYWRSR2gwc3FFLzRo?= =?utf-8?B?ZDZwNlNVeVVMbzJlTnMvSFdFNmhyYitNVlhWOTlnLzB4dTFpZVl1aDZNdUZ0?= =?utf-8?B?SlU5ZHlWemR2aFFzekR5bUcvRldlUWxwWkRhaFVneUNtSjBidVJkNXVWcXJn?= =?utf-8?B?SGNaNzdvUFh3eHpOOXdySmU4M1kyQ0lhV0dxbkF1N1NnTWFEVUROb1RWTFVL?= =?utf-8?B?WDltUHd5ZlV1Y2lPZ1poSUhHWit6Y2FWcUlJMzM1OGgxdC9MODErWWdvVzdq?= =?utf-8?B?Qlp2eXcvSjBFRERwRUVTU0dTUEt4NURa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pInnI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3114d91-f2e6-42f6-13b9-08de21ea1829 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2025 12:50:44.7099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T+/1A83palQGbDfl5KpWCErfR5+NCX4nNzfyxw30wJgdqBhMrCKFIuQZ6h6ag/4R X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB9042 X-Rspamd-Queue-Id: 75488A000D X-Stat-Signature: jcii7pq5h4uzjhgt54sq1kbegxpuqygx X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1762951850-36768 X-HE-Meta: U2FsdGVkX18tEvxgGJGWtP8nD7+lqaEMo0McFHEb+4PCwwA4p2jJDXscbqyQYiOBmTvZGaGWRFXtSiNmO1EsKY0Jyksp9ycH4X2aXpiDukW19t0BIgU4aD1g4I5BMZSeDERVK4NXyaX2dhngvn5h22U2fj7K3tvO3v2Y62BNZA3VDJvu/uZSvXCfbAvatz39q/IQEpbXkSd2OQ1a0TvNSPcPehXnYH8qwF8KQaq5k/fQIURJhYk5o0LDLqrHMkss8oXF/wDG5nmt9iOVLZ4oOB1D1sjWrza6k8+sLrvZmzoOWhjG3UDtaSRGql4CFyDDS65nNrzxnflKjmEAh+O+q+FjvhjwWk5ReM29DXEZim9L2LRrSSHLYkem4TUM6SGAvPpUxvaGS+h7r/GNifs3t/t16wHeGe7ku589dW0y/igTeuav914JJgY4llVzk9R5uYmtJIrysGH+oblUlRQWhAMxYskfxdl3aEu5Cu/6zvV//qI6LV/xl9Qc2v4YADILsMN5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.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: Hi Honglei, On 11/12/25 13:10, Honglei1.Huang@amd.com wrote: >>> Paravirtualized environments exacerbate this issue, as KVM's memory backing >>> is often non-contiguous at the host level. In virtualized environments, guest >>> physical memory appears contiguous to the VM but is actually scattered across >>> host memory pages. This fragmentation means that what appears as a single >>> large allocation in the guest may require multiple discrete SVM registrations >>> to properly handle the underlying host memory layout, further multiplying the >>> number of required ioctl calls. >> SVM with dynamic migration under KVM is most likely a dead end to begin with. >> >> The only possibility to implement it is with memory pinning which is basically userptr. >> >> Or a rather slow client side IOMMU emulation to catch concurrent DMA transfers to get the necessary information onto the host side. >> >> Intel calls this approach colIOMMU: https://www.usenix.org/system/files/atc20-paper236-slides-tian.pdf >> > > This is very helpful context.Your confirmation that memory pinning (userptr-style) is the practical approach helps me understand that what I initially saw as a "workaround" is actually the intended solution for this use case. Well "intended" is maybe not the right term, I would rather say "possible" with the current SW/HW stack design in virtualization. In general fault based SVM/HMM would still be nice to have even under virtualization environment, it's just simply not really feasible at the moment. > For colIOMMU, I'll study it to better understand the alternatives and their trade-offs. I haven't looked into it in detail either. It's mostly developed with the pass-through use case in mind, but avoiding pinning memory on the host side which is one of many per-requisites to have some HMM based migration working as well. ...>>> Why Submit This RFC? >>> ==================== >>> >>> Despite the limitations above, I am submitting this series to: >>> >>> 1. **Start the Discussion**: I want community feedback on whether batch >>>     registration is a useful feature worth pursuing. >>> >>> 2. **Explore Better Alternatives**: Is there a way to achieve batch >>>     registration without pinning? Could I extend HMM to better support >>>     this use case? >> >> There is an ongoing unification project between KFD and KGD, we are currently looking into the SVM part on a weekly basis. >> >> Saying that we probably need a really good justification to add new features to the KFD interfaces cause this is going to delay the unification. >> >> Regards, >> Christian. > > Thank you for sharing this critical information. Is there a public discussion forum or mailing list for the KFD/KGD unification where I could follow progress and understand the design direction? Alex is driving this. No mailing list, but IIRC Alex has organized a lot of topics on some confluence page, but I can't find it of hand. > Regarding the use case justification: I need to be honest here - the > primary driver for this feature is indeed KVM/virtualized environments. > The scattered allocation problem exists in native environments too, but > the overhead is tolerable there. However, I do want to raise one consideration for the unified interface design: > > GPU computing in virtualized/cloud environments is growing rapidly, major cloud providers (AWS, Azure) now offer GPU instances ROCm in containers/VMs is becoming more common.So while my current use case is specific to KVM, the virtualized GPU workload pattern may become more prevalent. > > So during the unified interface design, please keep the door open for batch-style operations if they don't complicate the core design. Oh, yes! That's definitely valuable information to have and a more or less a new requirement for the SVM userspace API. I already expected that we sooner or later run into such things, but having it definitely confirmed is really good to have. Regards, Christian. > > I really appreciate your time and guidance on this. > > Regards, > Honglei > > > >> >>> >>> 3. **Understand Trade-offs**: For some workloads, the performance benefit >>>     of batch registration might outweigh the drawbacks of pinning. I'd >>>     like to understand where the balance lies. >>> >>> Questions for the Community >>> ============================ >>> >>> 1. Are there existing mechanisms in HMM or mm that could support batch >>>     operations without pinning? >>> >>> 2. Would a different approach (e.g., async registration, delayed validation) >>>     be more acceptable? >>> >>> Alternative Approaches Considered >>> ================================== >>> >>> I've considered several alternatives: >>> >>> A) **Pure HMM approach**: Register ranges without pinning, rely entirely on >>> >>> B) **Userspace batching library**: Hide multiple ioctls behind a library. >>> >>> Patch Series Overview >>> ===================== >>> >>> Patch 1: Add KFD_IOCTL_SVM_ATTR_MAPPED attribute type >>> Patch 2: Define data structures for batch SVM range registration >>> Patch 3: Add new AMDKFD_IOC_SVM_RANGES ioctl command >>> Patch 4: Implement page pinning mechanism for scattered ranges >>> Patch 5: Wire up the ioctl handler and attribute processing >>> >>> Testing >>> ======= >>> >>> The series has been tested with: >>> - Multiple scattered malloc() allocations (2-2000+ ranges) >>> - Various allocation sizes (4KB to 1G+) >>> - GPU compute workloads using the registered ranges >>> - Memory pressure scenarios >>> - OpecnCL CTS in KVM guest environment >>> - HIP catch tests in KVM guest environment >>> - Some AI applications like Stable Diffusion, ComfyUI, 3B LLM models based >>>    on HuggingFace transformers >>> >>> I understand this approach is not ideal and are committed to working on a >>> better solution based on community feedback. This RFC is the starting point >>> for that discussion. >>> >>> Thank you for your time and consideration. >>> >>> Best regards, >>> Honglei Huang >>> >>> --- >>> >>> Honglei Huang (5): >>>    drm/amdkfd: Add KFD_IOCTL_SVM_ATTR_MAPPED attribute >>>    drm/amdkfd: Add SVM ranges data structures >>>    drm/amdkfd: Add AMDKFD_IOC_SVM_RANGES ioctl command >>>    drm/amdkfd: Add support for pinned user pages in SVM ranges >>>    drm/amdkfd: Wire up SVM ranges ioctl handler >>> >>>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c |  67 +++++++++++ >>>   drivers/gpu/drm/amd/amdkfd/kfd_svm.c     | 232 +++++++++++++++++++++++++++++-- >>>   drivers/gpu/drm/amd/amdkfd/kfd_svm.h     |   3 + >>>   include/uapi/linux/kfd_ioctl.h           |  52 +++++++- >>>   4 files changed, 348 insertions(+), 6 deletions(-) >> >