* About NUMA support in drmsvm helpers
@ 2026-11-23 10:44 Huang, Honglei
2026-11-23 11:04 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: Huang, Honglei @ 2026-11-23 10:44 UTC (permalink / raw)
To: Matthew Brost, Danilo Krummrich, Thomas Hellström,
Alice Ryhl
Cc: Simona Vetter, Alex Deucher, Kuehling, Felix,
Christian König, Huang Rui, dri-devel, Honglei Huang
Hi all,
A NUMA issue is found in another thread in [1]
We also encountered a similar issue, performance drop occurs when NUMA
balance is enabled.
And there is one more thing about NUMA:
The current amdgpu drmsvm can specify system memory as a destination,
but not a specific CPU NUMA node.
This has impact on some platforms like MI300A that feature unified
memory for CPU and GPU. We did a test for 2GB memory accessing in node
0 and node 3. GPU read/write bandwidth averaged about 2.78 TB/s with
local pages and 103 GB/s with remote pages, it differs a lot.
There is a requirement from AMD HIP to specify certain SVM memory to
specific NUMA nodes. But KFD also can not support NUMA fully. So the HIP
runtime have to use linux NUMA facilities to move memory to the correct
NUMA node, this could lead to unnecessary ram to ram migration.
And it also can not solve VRAM to RAM evict to error NUMA node issue.
Would it make sense for drm_gpusvm helpers to let a caller pass a
preferred NUMA node by interface? An explicit destination node for
migration to system memory.
[1]:
https://lore.kernel.org/all/b32fb02a-68b4-4db9-83dd-254147dbf215@kernel.org/
Regards,
Honglei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: About NUMA support in drmsvm helpers
2026-11-23 10:44 About NUMA support in drmsvm helpers Huang, Honglei
@ 2026-11-23 11:04 ` Christian König
2026-11-24 6:55 ` Huang, Honglei
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2026-11-23 11:04 UTC (permalink / raw)
To: Huang, Honglei, Matthew Brost, Danilo Krummrich,
Thomas Hellström, Alice Ryhl
Cc: Simona Vetter, Alex Deucher, Kuehling, Felix, Huang Rui,
dri-devel, Honglei Huang
Hi Honglei,
On 11/23/26 11:44, Huang, Honglei wrote:
>
> Hi all,
>
> A NUMA issue is found in another thread in [1]
>
> We also encountered a similar issue, performance drop occurs when NUMA balance is enabled.
>
> And there is one more thing about NUMA:
> The current amdgpu drmsvm can specify system memory as a destination, but not a specific CPU NUMA node.
Yeah I think that is by design. the NUMA node a page ends up when being migrated back from VRAM to system memory should be determined by the original backing store/address space and not the driver who migrates it back.
In other words when applications said that it wants their buffers to be placed on node X it is not up to the driver to mess with that.
> This has impact on some platforms like MI300A that feature unified memory for CPU and GPU. We did a test for 2GB memory accessing in node
> 0 and node 3. GPU read/write bandwidth averaged about 2.78 TB/s with local pages and 103 GB/s with remote pages, it differs a lot.
>
> There is a requirement from AMD HIP to specify certain SVM memory to specific NUMA nodes. But KFD also can not support NUMA fully. So the HIP runtime have to use linux NUMA facilities to move memory to the correct NUMA node, this could lead to unnecessary ram to ram migration.
> And it also can not solve VRAM to RAM evict to error NUMA node issue.
>
> Would it make sense for drm_gpusvm helpers to let a caller pass a preferred NUMA node by interface? An explicit destination node for migration to system memory.
I think we just need to make sure that the NUMA preferences of the process and any setting specified by madvise() and co are taken into account.
Regards,
Christian.
>
> [1]: https://lore.kernel.org/all/b32fb02a-68b4-4db9-83dd-254147dbf215@kernel.org/
>
> Regards,
> Honglei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: About NUMA support in drmsvm helpers
2026-11-23 11:04 ` Christian König
@ 2026-11-24 6:55 ` Huang, Honglei
2026-11-24 13:54 ` Thomas Hellström
0 siblings, 1 reply; 5+ messages in thread
From: Huang, Honglei @ 2026-11-24 6:55 UTC (permalink / raw)
To: Christian König
Cc: Simona Vetter, Alex Deucher, Kuehling, Felix, Huang Rui,
dri-devel, Honglei Huang, Matthew Brost, Danilo Krummrich,
Thomas Hellström, Alice Ryhl
On 11/23/2026 7:04 PM, Christian König wrote:
> Hi Honglei,
>
> On 11/23/26 11:44, Huang, Honglei wrote:
>>
>> Hi all,
>>
>> A NUMA issue is found in another thread in [1]
>>
>> We also encountered a similar issue, performance drop occurs when NUMA balance is enabled.
>>
>> And there is one more thing about NUMA:
>> The current amdgpu drmsvm can specify system memory as a destination, but not a specific CPU NUMA node.
>
> Yeah I think that is by design. the NUMA node a page ends up when being migrated back from VRAM to system memory should be determined by the original backing store/address space and not the driver who migrates it back.
>
> In other words when applications said that it wants their buffers to be placed on node X it is not up to the driver to mess with that.
>
>> This has impact on some platforms like MI300A that feature unified memory for CPU and GPU. We did a test for 2GB memory accessing in node
>> 0 and node 3. GPU read/write bandwidth averaged about 2.78 TB/s with local pages and 103 GB/s with remote pages, it differs a lot.
>>
>> There is a requirement from AMD HIP to specify certain SVM memory to specific NUMA nodes. But KFD also can not support NUMA fully. So the HIP runtime have to use linux NUMA facilities to move memory to the correct NUMA node, this could lead to unnecessary ram to ram migration.
>> And it also can not solve VRAM to RAM evict to error NUMA node issue.
>>
>> Would it make sense for drm_gpusvm helpers to let a caller pass a preferred NUMA node by interface? An explicit destination node for migration to system memory.
>
> I think we just need to make sure that the NUMA preferences of the process and any setting specified by madvise() and co are taken into account.
>
So we should reuse existing MM mechanisms and respect application NUMA
policies, right?
Some changes may still be needed to cover the remaining gaps, and needs
do some test to verify the NUMA feature.
Regards,
Honglei
> Regards,
> Christian.
>
>>
>> [1]: https://lore.kernel.org/all/b32fb02a-68b4-4db9-83dd-254147dbf215@kernel.org/
>>
>> Regards,
>> Honglei
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: About NUMA support in drmsvm helpers
2026-11-24 6:55 ` Huang, Honglei
@ 2026-11-24 13:54 ` Thomas Hellström
2026-11-25 6:23 ` Huang, Honglei
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Hellström @ 2026-11-24 13:54 UTC (permalink / raw)
To: Huang, Honglei, Christian König
Cc: Simona Vetter, Alex Deucher, Kuehling, Felix, Huang Rui,
dri-devel, Honglei Huang, Matthew Brost, Danilo Krummrich,
Alice Ryhl
On Tue, 2026-11-24 at 14:55 +0800, Huang, Honglei wrote:
>
>
> On 11/23/2026 7:04 PM, Christian König wrote:
> > Hi Honglei,
> >
> > On 11/23/26 11:44, Huang, Honglei wrote:
> > >
> > > Hi all,
> > >
> > > A NUMA issue is found in another thread in [1]
> > >
> > > We also encountered a similar issue, performance drop occurs when
> > > NUMA balance is enabled.
> > >
> > > And there is one more thing about NUMA:
> > > The current amdgpu drmsvm can specify system memory as a
> > > destination, but not a specific CPU NUMA node.
> >
> > Yeah I think that is by design. the NUMA node a page ends up when
> > being migrated back from VRAM to system memory should be determined
> > by the original backing store/address space and not the driver who
> > migrates it back.
> >
> > In other words when applications said that it wants their buffers
> > to be placed on node X it is not up to the driver to mess with
> > that.
> >
> > > This has impact on some platforms like MI300A that feature
> > > unified memory for CPU and GPU. We did a test for 2GB memory
> > > accessing in node
> > > 0 and node 3. GPU read/write bandwidth averaged about 2.78 TB/s
> > > with local pages and 103 GB/s with remote pages, it differs a
> > > lot.
> > >
> > > There is a requirement from AMD HIP to specify certain SVM memory
> > > to specific NUMA nodes. But KFD also can not support NUMA fully.
> > > So the HIP runtime have to use linux NUMA facilities to move
> > > memory to the correct NUMA node, this could lead to unnecessary
> > > ram to ram migration.
> > > And it also can not solve VRAM to RAM evict to error NUMA node
> > > issue.
> > >
> > > Would it make sense for drm_gpusvm helpers to let a caller pass a
> > > preferred NUMA node by interface? An explicit destination node
> > > for migration to system memory.
> >
> > I think we just need to make sure that the NUMA preferences of the
> > process and any setting specified by madvise() and co are taken
> > into account.
> >
>
> So we should reuse existing MM mechanisms and respect application
> NUMA
> policies, right?
> Some changes may still be needed to cover the remaining gaps, and
> needs
> do some test to verify the NUMA feature.
I think NUMA process settings can be tricky since the recoverable
pagefaults (be it SVA or hmm) run from a kernel thread that doesn't
have the process' numa policy.
However NUMA policies set with the mbind() system call should AFAICT
automatically be honored by both hmm and SVA.
Thanks,
Thomas
>
> Regards,
> Honglei
>
>
> > Regards,
> > Christian.
> >
> > >
> > > [1]:
> > > https://lore.kernel.org/all/b32fb02a-68b4-4db9-83dd-254147dbf215@kernel.org/
> > >
> > > Regards,
> > > Honglei
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: About NUMA support in drmsvm helpers
2026-11-24 13:54 ` Thomas Hellström
@ 2026-11-25 6:23 ` Huang, Honglei
0 siblings, 0 replies; 5+ messages in thread
From: Huang, Honglei @ 2026-11-25 6:23 UTC (permalink / raw)
To: Thomas Hellström
Cc: Simona Vetter, Alex Deucher, Kuehling, Felix, Huang Rui,
dri-devel, Honglei Huang, Matthew Brost, Danilo Krummrich,
Alice Ryhl, Christian König
On 11/24/2026 9:54 PM, Thomas Hellström wrote:
> On Tue, 2026-11-24 at 14:55 +0800, Huang, Honglei wrote:
>>
>>
>> On 11/23/2026 7:04 PM, Christian König wrote:
>>> Hi Honglei,
>>>
>>> On 11/23/26 11:44, Huang, Honglei wrote:
>>>>
>>>> Hi all,
>>>>
>>>> A NUMA issue is found in another thread in [1]
>>>>
>>>> We also encountered a similar issue, performance drop occurs when
>>>> NUMA balance is enabled.
>>>>
>>>> And there is one more thing about NUMA:
>>>> The current amdgpu drmsvm can specify system memory as a
>>>> destination, but not a specific CPU NUMA node.
>>>
>>> Yeah I think that is by design. the NUMA node a page ends up when
>>> being migrated back from VRAM to system memory should be determined
>>> by the original backing store/address space and not the driver who
>>> migrates it back.
>>>
>>> In other words when applications said that it wants their buffers
>>> to be placed on node X it is not up to the driver to mess with
>>> that.
>>>
>>>> This has impact on some platforms like MI300A that feature
>>>> unified memory for CPU and GPU. We did a test for 2GB memory
>>>> accessing in node
>>>> 0 and node 3. GPU read/write bandwidth averaged about 2.78 TB/s
>>>> with local pages and 103 GB/s with remote pages, it differs a
>>>> lot.
>>>>
>>>> There is a requirement from AMD HIP to specify certain SVM memory
>>>> to specific NUMA nodes. But KFD also can not support NUMA fully.
>>>> So the HIP runtime have to use linux NUMA facilities to move
>>>> memory to the correct NUMA node, this could lead to unnecessary
>>>> ram to ram migration.
>>>> And it also can not solve VRAM to RAM evict to error NUMA node
>>>> issue.
>>>>
>>>> Would it make sense for drm_gpusvm helpers to let a caller pass a
>>>> preferred NUMA node by interface? An explicit destination node
>>>> for migration to system memory.
>>>
>>> I think we just need to make sure that the NUMA preferences of the
>>> process and any setting specified by madvise() and co are taken
>>> into account.
>>>
>>
>> So we should reuse existing MM mechanisms and respect application
>> NUMA
>> policies, right?
>> Some changes may still be needed to cover the remaining gaps, and
>> needs
>> do some test to verify the NUMA feature.
>
> I think NUMA process settings can be tricky since the recoverable
> pagefaults (be it SVA or hmm) run from a kernel thread that doesn't
> have the process' numa policy.
>
> However NUMA policies set with the mbind() system call should AFAICT
> automatically be honored by both hmm and SVA.
>
Yes agreed, will continue testing and see if there are any functional
gaps and return to this mail thread.
Regards,
Honglei
> Thanks,
> Thomas
>
>
>
>>
>> Regards,
>> Honglei
>>
>>
>>> Regards,
>>> Christian.
>>>
>>>>
>>>> [1]:
>>>> https://lore.kernel.org/all/b32fb02a-68b4-4db9-83dd-254147dbf215@kernel.org/
>>>>
>>>> Regards,
>>>> Honglei
>>>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-25 6:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 10:44 About NUMA support in drmsvm helpers Huang, Honglei
2026-11-23 11:04 ` Christian König
2026-11-24 6:55 ` Huang, Honglei
2026-11-24 13:54 ` Thomas Hellström
2026-11-25 6:23 ` Huang, Honglei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.