* [PATCH] ttm/pool: allow debugfs dumps for numa pools.
@ 2025-06-02 20:40 Dave Airlie
2025-06-03 7:47 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: Dave Airlie @ 2025-06-02 20:40 UTC (permalink / raw)
To: dri-devel; +Cc: Dave Airlie, Christian König
From: Dave Airlie <airlied@redhat.com>
Currently you can't see per-device numa aware pools properly.
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/ttm/ttm_pool.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index ccc3b9a13e9e..43b69d061dff 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -1253,7 +1253,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
{
unsigned int i;
- if (!pool->use_dma_alloc) {
+ if (!pool->use_dma_alloc && pool->nid == NUMA_NO_NODE) {
seq_puts(m, "unused\n");
return 0;
}
@@ -1262,7 +1262,12 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
spin_lock(&shrinker_lock);
for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i) {
- seq_puts(m, "DMA ");
+ if (!ttm_pool_select_type(pool, i, 0))
+ continue;
+ if (pool->use_dma_alloc)
+ seq_puts(m, "DMA ");
+ else
+ seq_printf(m, "N%d ", pool->nid);
switch (i) {
case ttm_cached:
seq_puts(m, "\t:");
--
2.43.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ttm/pool: allow debugfs dumps for numa pools.
2025-06-02 20:40 [PATCH] ttm/pool: allow debugfs dumps for numa pools Dave Airlie
@ 2025-06-03 7:47 ` Christian König
2025-06-03 7:52 ` David Airlie
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2025-06-03 7:47 UTC (permalink / raw)
To: Dave Airlie, dri-devel; +Cc: Dave Airlie
On 6/2/25 22:40, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> Currently you can't see per-device numa aware pools properly.
>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Any follow up patch to wire this up in amdgpu?
Regards,
Christian.
> ---
> drivers/gpu/drm/ttm/ttm_pool.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index ccc3b9a13e9e..43b69d061dff 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -1253,7 +1253,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
> {
> unsigned int i;
>
> - if (!pool->use_dma_alloc) {
> + if (!pool->use_dma_alloc && pool->nid == NUMA_NO_NODE) {
> seq_puts(m, "unused\n");
> return 0;
> }
> @@ -1262,7 +1262,12 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
>
> spin_lock(&shrinker_lock);
> for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i) {
> - seq_puts(m, "DMA ");
> + if (!ttm_pool_select_type(pool, i, 0))
> + continue;
> + if (pool->use_dma_alloc)
> + seq_puts(m, "DMA ");
> + else
> + seq_printf(m, "N%d ", pool->nid);
> switch (i) {
> case ttm_cached:
> seq_puts(m, "\t:");
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ttm/pool: allow debugfs dumps for numa pools.
2025-06-03 7:47 ` Christian König
@ 2025-06-03 7:52 ` David Airlie
2025-06-03 8:50 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: David Airlie @ 2025-06-03 7:52 UTC (permalink / raw)
To: Christian König; +Cc: Dave Airlie, dri-devel
On Tue, Jun 3, 2025 at 5:47 PM Christian König <christian.koenig@amd.com> wrote:
>
> On 6/2/25 22:40, Dave Airlie wrote:
> > From: Dave Airlie <airlied@redhat.com>
> >
> > Currently you can't see per-device numa aware pools properly.
> >
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Any follow up patch to wire this up in amdgpu?
Just seems to work, at least I tested it on a 4 node MI300A system
this morning and
/sys/kernel/debug/dri/*/ttm_page_pool seems to reflect the correct pools.
Dave.
>
> Regards,
> Christian.
>
> > ---
> > drivers/gpu/drm/ttm/ttm_pool.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> > index ccc3b9a13e9e..43b69d061dff 100644
> > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > @@ -1253,7 +1253,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
> > {
> > unsigned int i;
> >
> > - if (!pool->use_dma_alloc) {
> > + if (!pool->use_dma_alloc && pool->nid == NUMA_NO_NODE) {
> > seq_puts(m, "unused\n");
> > return 0;
> > }
> > @@ -1262,7 +1262,12 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
> >
> > spin_lock(&shrinker_lock);
> > for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i) {
> > - seq_puts(m, "DMA ");
> > + if (!ttm_pool_select_type(pool, i, 0))
> > + continue;
> > + if (pool->use_dma_alloc)
> > + seq_puts(m, "DMA ");
> > + else
> > + seq_printf(m, "N%d ", pool->nid);
> > switch (i) {
> > case ttm_cached:
> > seq_puts(m, "\t:");
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ttm/pool: allow debugfs dumps for numa pools.
2025-06-03 7:52 ` David Airlie
@ 2025-06-03 8:50 ` Christian König
2025-06-03 22:02 ` Dave Airlie
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2025-06-03 8:50 UTC (permalink / raw)
To: David Airlie; +Cc: Dave Airlie, dri-devel
On 6/3/25 09:52, David Airlie wrote:
> On Tue, Jun 3, 2025 at 5:47 PM Christian König <christian.koenig@amd.com> wrote:
>>
>> On 6/2/25 22:40, Dave Airlie wrote:
>>> From: Dave Airlie <airlied@redhat.com>
>>>
>>> Currently you can't see per-device numa aware pools properly.
>>>
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>> Any follow up patch to wire this up in amdgpu?
>
> Just seems to work, at least I tested it on a 4 node MI300A system
> this morning and
>
> /sys/kernel/debug/dri/*/ttm_page_pool seems to reflect the correct pools.
Yeah that should work, but there is also the mode where we allocated the pool in the driver because the MI300 has connections to multiple NUMA nodes.
See amdgpu_ttm_tt_populate().
I will take care of this after that patch here lands.
Regards,
Christian.
>
> Dave.
>
>>
>> Regards,
>> Christian.
>>
>>> ---
>>> drivers/gpu/drm/ttm/ttm_pool.c | 9 +++++++--
>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
>>> index ccc3b9a13e9e..43b69d061dff 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_pool.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
>>> @@ -1253,7 +1253,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
>>> {
>>> unsigned int i;
>>>
>>> - if (!pool->use_dma_alloc) {
>>> + if (!pool->use_dma_alloc && pool->nid == NUMA_NO_NODE) {
>>> seq_puts(m, "unused\n");
>>> return 0;
>>> }
>>> @@ -1262,7 +1262,12 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
>>>
>>> spin_lock(&shrinker_lock);
>>> for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i) {
>>> - seq_puts(m, "DMA ");
>>> + if (!ttm_pool_select_type(pool, i, 0))
>>> + continue;
>>> + if (pool->use_dma_alloc)
>>> + seq_puts(m, "DMA ");
>>> + else
>>> + seq_printf(m, "N%d ", pool->nid);
>>> switch (i) {
>>> case ttm_cached:
>>> seq_puts(m, "\t:");
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ttm/pool: allow debugfs dumps for numa pools.
2025-06-03 8:50 ` Christian König
@ 2025-06-03 22:02 ` Dave Airlie
0 siblings, 0 replies; 5+ messages in thread
From: Dave Airlie @ 2025-06-03 22:02 UTC (permalink / raw)
To: Christian König; +Cc: David Airlie, dri-devel
On Tue, 3 Jun 2025 at 18:50, Christian König <christian.koenig@amd.com> wrote:
>
> On 6/3/25 09:52, David Airlie wrote:
> > On Tue, Jun 3, 2025 at 5:47 PM Christian König <christian.koenig@amd.com> wrote:
> >>
> >> On 6/2/25 22:40, Dave Airlie wrote:
> >>> From: Dave Airlie <airlied@redhat.com>
> >>>
> >>> Currently you can't see per-device numa aware pools properly.
> >>>
> >>> Cc: Christian König <christian.koenig@amd.com>
> >>> Signed-off-by: Dave Airlie <airlied@redhat.com>
> >>
> >> Reviewed-by: Christian König <christian.koenig@amd.com>
> >>
> >> Any follow up patch to wire this up in amdgpu?
> >
> > Just seems to work, at least I tested it on a 4 node MI300A system
> > this morning and
> >
> > /sys/kernel/debug/dri/*/ttm_page_pool seems to reflect the correct pools.
>
> Yeah that should work, but there is also the mode where we allocated the pool in the driver because the MI300 has connections to multiple NUMA nodes.
>
> See amdgpu_ttm_tt_populate().
>
> I will take care of this after that patch here lands.
>
I've landed this in drm-misc-next.
Thanks,
Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-03 22:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 20:40 [PATCH] ttm/pool: allow debugfs dumps for numa pools Dave Airlie
2025-06-03 7:47 ` Christian König
2025-06-03 7:52 ` David Airlie
2025-06-03 8:50 ` Christian König
2025-06-03 22:02 ` Dave Airlie
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.