drm/ttm: Use init_on_free to early release TTM BOs
Subsystems (3)
PATCH 1/1 drm/ttm: Use init_on_free to early release TTM BOs
Early release TTM BOs when the kernel default setting is init_on_free to wipe out and reinitialize system memory chunks. This could potentially optimize performance when an application does a lot of malloc/free style allocations with unified system memory.
--- drivers/gpu/drm/ttm/ttm_bo.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo.c +1 -0
@@ -347,6 +347,7 @@ static void ttm_bo_release(struct kref *kref)if (!dma_resv_test_signaled (bo->base.resv,DMA_RESV_USAGE_BOOKKEEP ) || + (want_init_on_free () && (bo->ttm !=NULL )) || !dma_resv_trylock (bo->base.resv)) {/* The BO is not idle, resurrect it for delayed destroy */ ttm_bo_flush_all_fences (bo);
Signature · 1 line
2.17.1
Am 05.07.23 um 21:57 schrieb Rajneesh Bhardwaj:
Quoted 2 lines
Early release TTM BOs when the kernel default setting is
init_on_freeto wipe out and reinitialize system memory chunks.
"Delay release the TTM BO when the kernels init_on_free setting is used."
Quoted 3 lines
This could potentially
optimize performance when an application does a lot of malloc/free style allocations with unified system memory.
"This offloads the overhead of clearing the system memory to the work item and potentially a different CPU. And is very beneficial when the application does a lot of malloc/free style allocations of system memory."
With those changes to the commit message the patch is Reviewed-by: Christian König <[email protected]>.
I'm going to push that to drm-misc-next when you send it out once more.
Thanks,
Christian.
Quoted 18 lines
Signed-off-by Rajneesh Bhardwaj <[email protected]>--- drivers/gpu/drm/ttm/ttm_bo.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo.c +1
-0@@ -347,6 +347,7 @@ static void ttm_bo_release(struct kref *kref)if (!dma_resv_test_signaled (bo->base.resv,DMA_RESV_USAGE_BOOKKEEP ) || + (want_init_on_free () && (bo->ttm !=NULL )) || !dma_resv_trylock (bo->base.resv)) {/* The BO is not idle, resurrect it for delayed destroy */ ttm_bo_flush_all_fences (bo);