Skip to contentSkip to conversation

drm/ttm: Ignore signaled move fences

PATCH In review Felix Kuehling 2 participants 5 messages Feb 27, 2021 – Mar 5, 2021

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

PATCH 1/1 drm/ttm: Ignore signaled move fences

Move fences that have already signaled should not prevent memory allocations with no_wait_gpu.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index 3a10bebb75d6..de1ec838cf8b 100644
@@ -730,8 +730,9 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
 		return 0;
 
 	if (no_wait_gpu) {
+		ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
 		dma_fence_put(fence);
-		return -EBUSY;
+		return ret;
 	}
 
 	dma_resv_add_shared_fence(bo->base.resv, fence);
Signature · 6 lines
2.30.0

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

Am 27.02.21 um 04:45 schrieb Felix Kuehling:

Quoted 4 lines

Move fences that have already signaled should not prevent memory allocations with no_wait_gpu.

Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 3a10bebb75d6..de1ec838cf8b 100644

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

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -730,8 +730,9 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
  		return 0;
 
  	if (no_wait_gpu) {
+		ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
  		dma_fence_put(fence);
-		return -EBUSY;
+		return ret;
  	}
 
  	dma_resv_add_shared_fence(bo->base.resv, fence);

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

#2 lore raw

Am 2021-03-01 um 10:09 a.m. schrieb Christian König:

Quoted 7 lines

Am 27.02.21 um 04:45 schrieb Felix Kuehling:

Quoted 4 lines

Move fences that have already signaled should not prevent memory allocations with no_wait_gpu.

I work on this on Alex's rebased amd-staging-drm-next. Should this go into any other branches?

Thanks,
  Felix

Quoted 5 lines
Quoted 5 lines

---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 15 lines
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 3a10bebb75d6..de1ec838cf8b 100644

drivers/gpu/drm/ttm/ttm_bo.c static int ttm_bo_add_move_fence(struct · line 737

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -730,8 +730,9 @@ static int ttm_bo_add_move_fence(struct
 ttm_buffer_object *bo,
           return 0;
         if (no_wait_gpu) {
+        ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
           dma_fence_put(fence);
-        return -EBUSY;
+        return ret;
       }
         dma_resv_add_shared_fence(bo->base.resv, fence);

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

#3 lore raw

Am 05.03.21 um 02:21 schrieb Felix Kuehling:

Quoted 9 lines

Am 2021-03-01 um 10:09 a.m. schrieb Christian König:

Quoted 6 lines

Am 27.02.21 um 04:45 schrieb Felix Kuehling:

Quoted 4 lines

Move fences that have already signaled should not prevent memory allocations with no_wait_gpu.

I work on this on Alex's rebased amd-staging-drm-next. Should this go into any other branches?

I have a branch with stuff for 5.13 which I want to push to drm-misc-next as soon as 5.12-rc1 is out.

Going to add this one here to that collection as well unless you say that this is really a bug fix and we need it earlier.

Regards,
Christian.

Quoted 9 lines

Thanks,
  Felix

Quoted 4 lines
Quoted 4 lines
---
   drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 3a10bebb75d6..de1ec838cf8b 100644
@@ -730,8 +730,9 @@ static int ttm_bo_add_move_fence(struct
 ttm_buffer_object *bo,
Quoted 8 lines

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

Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
           return 0;
         if (no_wait_gpu) {
+        ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
           dma_fence_put(fence);
-        return -EBUSY;
+        return ret;
       }
         dma_resv_add_shared_fence(bo->base.resv, fence);

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

#4 lore raw

It fixed an intermittent failure to allocate page tables in the page fault handler (turning retry faults into no-retry faults). I'm not sure if this caused real problems. I think it could potentially result in fault storms and a failure to report page faults properly. I'm not sure if it's a regression or was always present. So I'm not sure if it's an urgent fix.

Regards,
  Felix

Am 2021-03-05 um 2:56 a.m. schrieb Christian König:

Quoted 31 lines

Am 05.03.21 um 02:21 schrieb Felix Kuehling:

Quoted 9 lines

Am 2021-03-01 um 10:09 a.m. schrieb Christian König:

Quoted 6 lines

Am 27.02.21 um 04:45 schrieb Felix Kuehling:

Quoted 4 lines

Move fences that have already signaled should not prevent memory allocations with no_wait_gpu.

I work on this on Alex's rebased amd-staging-drm-next. Should this go into any other branches?

I have a branch with stuff for 5.13 which I want to push to drm-misc-next as soon as 5.12-rc1 is out.

Going to add this one here to that collection as well unless you say that this is really a bug fix and we need it earlier.

Regards,
Christian.

Quoted 9 lines

Thanks,
   Felix

Quoted 4 lines
Quoted 4 lines

---
   drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-

   1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 3a10bebb75d6..de1ec838cf8b 100644
@@ -730,8 +730,9 @@ static int ttm_bo_add_move_fence(struct
 ttm_buffer_object *bo,
Quoted 8 lines
Quoted 8 lines

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

Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
            return 0;
          if (no_wait_gpu) {
+        ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
            dma_fence_put(fence);
-        return -EBUSY;
+        return ret;
        }
          dma_resv_add_shared_fence(bo->base.resv, fence);

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