ttm/pool: Don't leak LRU list on shutdown
Subsystems (3)
PATCH 1/1 ttm/pool: Don't leak LRU list on shutdown
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.
--- drivers/gpu/drm/ttm/ttm_pool.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_pool.c +1 -0
@@ -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 */
Signature · 1 line
2.54.0
Quoted 8 lines · Ian Forbes
TTM pool was changed from a regular list to an lru list in the referenced fixes commit.
list_lru_initallocates 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 <[email protected]>
Quoted 16 lines
--- drivers/gpu/drm/ttm/ttm_pool.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_pool.c +1
-0@@ -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 */
Quoted 22 lines · Christian König
Quoted 8 lines · Ian Forbes
TTM pool was changed from a regular list to an lru list in the referenced fixes commit.
list_lru_initallocates 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 <[email protected]>Reviewed-by Christian König <[email protected]>Quoted 10 lines
--- drivers/gpu/drm/ttm/ttm_pool.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_pool.c +0
-0@@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
Quoted 6 lines
drivers/gpu/drm/ttm/ttm_pool.c static void ttm_pool_type_fini(struct ttm_pool_type *pt) · line 401
Quoted 6 lines
drivers/gpu/drm/ttm/ttm_pool.c +1
-0list_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?
Thanks,
Pushed to drm-misc-fixes now.
Dave.
Quoted 33 lines · Fedor Pchelkin
Quoted 22 lines · Christian König
Quoted 8 lines · Ian Forbes
TTM pool was changed from a regular list to an lru list in the referenced fixes commit.
list_lru_initallocates 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 <[email protected]>Reviewed-by Christian König <[email protected]>Quoted 10 lines
--- drivers/gpu/drm/ttm/ttm_pool.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_pool.c +0
-0@@ -395,6 +395,7 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)Quoted 6 lines
drivers/gpu/drm/ttm/ttm_pool.c static void ttm_pool_type_fini(struct ttm_pool_type *pt) · line 401
Quoted 6 lines
drivers/gpu/drm/ttm/ttm_pool.c +1
-0list_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?