All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ttm/pool: Don't leak LRU list on shutdown
@ 2026-05-27 20:20 Ian Forbes
  2026-05-28  7:24 ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Forbes @ 2026-05-27 20:20 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, airlied, Ian Forbes

TTM pool was changed from a regular list to an lru list in the
referenced fixes commit. list_lru_init allocates state and it needs to
be freed unlike a simple list.

Found using the igt@core_hotunplug and kmemleak.

Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index 26a3689e5fd9..a41addbf3ddf 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
 
 	list_lru_walk(&pt->pages, pool_move_to_dispose_list, &dispose, LONG_MAX);
 	ttm_pool_dispose_list(pt, &dispose);
+	list_lru_destroy(&pt->pages);
 }
 
 /* Return the pool_type to use for the given caching and order */
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm/pool: Don't leak LRU list on shutdown
  2026-05-27 20:20 [PATCH] ttm/pool: Don't leak LRU list on shutdown Ian Forbes
@ 2026-05-28  7:24 ` Christian König
  2026-11-22 11:13   ` Fedor Pchelkin
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2026-05-28  7:24 UTC (permalink / raw)
  To: Ian Forbes, dri-devel; +Cc: airlied

On 5/27/26 22:20, Ian Forbes wrote:
> TTM pool was changed from a regular list to an lru list in the
> referenced fixes commit. list_lru_init allocates state and it needs to
> be freed unlike a simple list.
> 
> Found using the igt@core_hotunplug and kmemleak.
> 
> Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)")
> Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index 26a3689e5fd9..a41addbf3ddf 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
>  
>  	list_lru_walk(&pt->pages, pool_move_to_dispose_list, &dispose, LONG_MAX);
>  	ttm_pool_dispose_list(pt, &dispose);
> +	list_lru_destroy(&pt->pages);
>  }
>  
>  /* Return the pool_type to use for the given caching and order */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm/pool: Don't leak LRU list on shutdown
  2026-05-28  7:24 ` Christian König
@ 2026-11-22 11:13   ` Fedor Pchelkin
  2026-11-23  0:35     ` Dave Airlie
  0 siblings, 1 reply; 5+ messages in thread
From: Fedor Pchelkin @ 2026-11-22 11:13 UTC (permalink / raw)
  To: Christian König, airlied, dri-devel; +Cc: Ian Forbes

Christian König wrote:
> On 5/27/26 22:20, Ian Forbes wrote:
> > TTM pool was changed from a regular list to an lru list in the
> > referenced fixes commit. list_lru_init allocates state and it needs to
> > be freed unlike a simple list.
> > 
> > Found using the igt@core_hotunplug and kmemleak.
> > 
> > Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)")
> > Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> > ---
> >  drivers/gpu/drm/ttm/ttm_pool.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> > index 26a3689e5fd9..a41addbf3ddf 100644
> > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > @@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
> >  
> >  	list_lru_walk(&pt->pages, pool_move_to_dispose_list, &dispose, LONG_MAX);
> >  	ttm_pool_dispose_list(pt, &dispose);
> > +	list_lru_destroy(&pt->pages);
> >  }
> >  
> >  /* Return the pool_type to use for the given caching and order */

The patch probably fell through the cracks.  Can't find it at drm-tip.git.
Would you apply this, please?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm/pool: Don't leak LRU list on shutdown
  2026-11-22 11:13   ` Fedor Pchelkin
@ 2026-11-23  0:35     ` Dave Airlie
  2026-11-24 13:01       ` Thomas Hellström
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Airlie @ 2026-11-23  0:35 UTC (permalink / raw)
  To: Fedor Pchelkin; +Cc: Christian König, airlied, dri-devel, Ian Forbes

Thanks,

Pushed to drm-misc-fixes now.

Dave.

On Sun, 22 Nov 2026 at 22:16, Fedor Pchelkin <pchelkin@ispras.ru> wrote:
>
> Christian König wrote:
> > On 5/27/26 22:20, Ian Forbes wrote:
> > > TTM pool was changed from a regular list to an lru list in the
> > > referenced fixes commit. list_lru_init allocates state and it needs to
> > > be freed unlike a simple list.
> > >
> > > Found using the igt@core_hotunplug and kmemleak.
> > >
> > > Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)")
> > > Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
> >
> > Reviewed-by: Christian König <christian.koenig@amd.com>
> >
> > > ---
> > >  drivers/gpu/drm/ttm/ttm_pool.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> > > index 26a3689e5fd9..a41addbf3ddf 100644
> > > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > > @@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
> > >
> > >     list_lru_walk(&pt->pages, pool_move_to_dispose_list, &dispose, LONG_MAX);
> > >     ttm_pool_dispose_list(pt, &dispose);
> > > +   list_lru_destroy(&pt->pages);
> > >  }
> > >
> > >  /* Return the pool_type to use for the given caching and order */
>
> The patch probably fell through the cracks.  Can't find it at drm-tip.git.
> Would you apply this, please?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm/pool: Don't leak LRU list on shutdown
  2026-11-23  0:35     ` Dave Airlie
@ 2026-11-24 13:01       ` Thomas Hellström
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Hellström @ 2026-11-24 13:01 UTC (permalink / raw)
  To: Dave Airlie, Fedor Pchelkin
  Cc: Christian König, airlied, dri-devel, Ian Forbes

Hi,

On Mon, 2026-11-23 at 10:35 +1000, Dave Airlie wrote:
> Thanks,
> 
> Pushed to drm-misc-fixes now.
> 
> Dave.

This breaks TTM kunit tests. 
https://lore.kernel.org/r/179551898058.76739.11365088738563088346@9ac1b63fe3ea

Thanks,
Thomas

> 
> On Sun, 22 Nov 2026 at 22:16, Fedor Pchelkin <pchelkin@ispras.ru>
> wrote:
> > 
> > Christian König wrote:
> > > On 5/27/26 22:20, Ian Forbes wrote:
> > > > TTM pool was changed from a regular list to an lru list in the
> > > > referenced fixes commit. list_lru_init allocates state and it
> > > > needs to
> > > > be freed unlike a simple list.
> > > > 
> > > > Found using the igt@core_hotunplug and kmemleak.
> > > > 
> > > > Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)")
> > > > Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
> > > 
> > > Reviewed-by: Christian König <christian.koenig@amd.com>
> > > 
> > > > ---
> > > >  drivers/gpu/drm/ttm/ttm_pool.c | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c
> > > > b/drivers/gpu/drm/ttm/ttm_pool.c
> > > > index 26a3689e5fd9..a41addbf3ddf 100644
> > > > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > > > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > > > @@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct
> > > > ttm_pool_type *pt)
> > > > 
> > > >     list_lru_walk(&pt->pages, pool_move_to_dispose_list,
> > > > &dispose, LONG_MAX);
> > > >     ttm_pool_dispose_list(pt, &dispose);
> > > > +   list_lru_destroy(&pt->pages);
> > > >  }
> > > > 
> > > >  /* Return the pool_type to use for the given caching and order
> > > > */
> > 
> > The patch probably fell through the cracks.  Can't find it at drm-
> > tip.git.
> > Would you apply this, please?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-24 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 20:20 [PATCH] ttm/pool: Don't leak LRU list on shutdown Ian Forbes
2026-05-28  7:24 ` Christian König
2026-11-22 11:13   ` Fedor Pchelkin
2026-11-23  0:35     ` Dave Airlie
2026-11-24 13:01       ` Thomas Hellström

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.