Skip to contentSkip to conversation

drm/ttm: fix pipelined gutting for evictions v2

PATCH In review Christian König 3 participants 3 messages Jul 24, 2020 – Jul 26, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: fix pipelined gutting for evictions v2

We can't pipeline that during eviction because the memory needs to be available immediately.

v2: fix how we cleanup the BOs resources

---
 drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +6 -2
index 0768a054a916..469aa93ea317 100644
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
 	placement.num_busy_placement = 0;
 	bdev->driver->evict_flags(bo, &placement);
 
-	if (!placement.num_placement && !placement.num_busy_placement)
-		return ttm_bo_pipeline_gutting(bo);
+	if (!placement.num_placement && !placement.num_busy_placement) {
+		ttm_bo_wait(bo, false, false);
+
+		ttm_bo_cleanup_memtype_use(bo);
+		return 0;
+	}
 
 	evict_mem = bo->mem;
 	evict_mem.mm_node = NULL;
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 2020-07-24 um 7:56 a.m. schrieb Christian König:

Quoted 6 lines

We can't pipeline that during eviction because the memory needs to be available immediately.

v2: fix how we cleanup the BOs resources

It would be good to get a Tested-by from Alex as well.

Thanks,
  Felix

Quoted 13 lines
---
 drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -1
index 0768a054a916..469aa93ea317 100644
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
 	placement.num_busy_placement = 0;
 	bdev->driver->evict_flags(bo, &placement);
 
-	if (!placement.num_placement && !placement.num_busy_placement)

drivers/gpu/drm/ttm/ttm_bo.c static int ttm_bo_evict(struct ttm_buffer_object *bo, · line 663

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo.c +6 -1
-		return ttm_bo_pipeline_gutting(bo);
+	if (!placement.num_placement && !placement.num_busy_placement) {
+		ttm_bo_wait(bo, false, false);
+
+		ttm_bo_cleanup_memtype_use(bo);
+		return 0;
+	}
 
 	evict_mem = bo->mem;
 	evict_mem.mm_node = NULL;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 6 lines · Felix Kuehling

Am 2020-07-24 um 7:56 a.m. schrieb Christian König:

Quoted 5 lines

We can't pipeline that during eviction because the memory needs to be available immediately.

v2: fix how we cleanup the BOs resources

Quoted 7 lines
Quoted 1 line

It would be good to get a Tested-by from Alex as well.

Thanks,
  Felix

Regards,

Alex Sierra

Quoted 22 lines
Quoted 22 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +6 -2
index 0768a054a916..469aa93ea317 100644
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
  	placement.num_busy_placement = 0;
  	bdev->driver->evict_flags(bo, &placement);
 
-	if (!placement.num_placement && !placement.num_busy_placement)
-		return ttm_bo_pipeline_gutting(bo);
+	if (!placement.num_placement && !placement.num_busy_placement) {
+		ttm_bo_wait(bo, false, false);
+
+		ttm_bo_cleanup_memtype_use(bo);
+		return 0;
+	}
 
Quoted 2 lines

drivers/gpu/drm/ttm/ttm_bo.c static int ttm_bo_evict(struct ttm_buffer_object *bo, · line 663

Quoted 2 lines
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
  	evict_mem = bo->mem;
  	evict_mem.mm_node = NULL;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel