[PATCH] ttm/pool: allow debugfs dumps for numa pools.
David Airlie
airlied at redhat.com
Tue Jun 3 07:52:01 UTC 2025
On Tue, Jun 3, 2025 at 5:47 PM Christian König <christian.koenig at amd.com> wrote:
>
> On 6/2/25 22:40, Dave Airlie wrote:
> > From: Dave Airlie <airlied at redhat.com>
> >
> > Currently you can't see per-device numa aware pools properly.
> >
> > Cc: Christian König <christian.koenig at amd.com>
> > Signed-off-by: Dave Airlie <airlied at redhat.com>
>
> Reviewed-by: Christian König <christian.koenig at 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:");
>
More information about the dri-devel
mailing list