Skip to content

Commit 35d67ee

Browse files
rajbharChristianKoenigAMD
authored andcommitted
drm/ttm: Use init_on_free to delay release TTM BOs
Delay release TTM BOs when the kernel default setting is init_on_free. This offloads the overhead of clearing the system memory to the work item and potentially a different CPU. This could be very beneficial when the application does a lot of malloc/free style allocations of system memory. Signed-off-by: Rajneesh Bhardwaj <[email protected]> Reviewed-by: Christian König <[email protected]>. Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
1 parent 45a4ff6 commit 35d67ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ static void ttm_bo_release(struct kref *kref)
345345

346346
if (!dma_resv_test_signaled(bo->base.resv,
347347
DMA_RESV_USAGE_BOOKKEEP) ||
348+
(want_init_on_free() && (bo->ttm != NULL)) ||
348349
!dma_resv_trylock(bo->base.resv)) {
349350
/* The BO is not idle, resurrect it for delayed destroy */
350351
ttm_bo_flush_all_fences(bo);

0 commit comments

Comments
 (0)