Skip to contentSkip to conversation

drm/amdgpu: Don't warn on destroying a pinned BO

PATCH In review Michel Dänzer 4 participants 6 messages Jul 19, 2018 – Jul 24, 2018 3 messages not in the archive

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

PATCH 1/1 drm/amdgpu: Don't warn on destroying a pinned BO

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
index b12526ce1a9d..3010f0136de9 100644
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 	struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
 	struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
 
-	if (WARN_ON_ONCE(bo->pin_count > 0))
+	if (bo->pin_count > 0)
 		amdgpu_bo_subtract_pin_size(bo);
 
 	if (bo->kfd_bo)
Signature · 6 lines
2.18.0

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

A message that is not in the archive (sent off-list or not yet received): 20180719153955.23910-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw
Quoted 19 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index b12526ce1a9d..3010f0136de9 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 95

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 	struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
 	struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
 
-	if (WARN_ON_ONCE(bo->pin_count > 0))
+	if (bo->pin_count > 0)
 		amdgpu_bo_subtract_pin_size(bo);
 
 	if (bo->kfd_bo)

Any feedback?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): b39b0ced-3a54-b18c-0e90-e829b21afd17-otUistvHUpPR7s880joybQ@public.gmane.org

Acked-by
#4 lore raw
Quoted 22 lines · Michel Dänzer
Quoted 21 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index b12526ce1a9d..3010f0136de9 100644
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
      struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
      struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
 
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 95

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
-     if (WARN_ON_ONCE(bo->pin_count > 0))
+     if (bo->pin_count > 0)
              amdgpu_bo_subtract_pin_size(bo);
 
      if (bo->kfd_bo)

Any feedback?

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

Tested-by
#5 lore raw
In reply to a message not in the archive

Hi

I was hitting this

Feel free to add my tested by

Cheers

Mike

Quoted 34 lines · On Mon, 23 Jul 2018 at 17:50 Michel Dänzer…
Quoted 8 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

Review

Quoted 6 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct

Quoted 4 lines

index b12526ce1a9d..3010f0136de9 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct

ttm_buffer_object *tbo)

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 95

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
      struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
      struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
 
-     if (WARN_ON_ONCE(bo->pin_count > 0))
+     if (bo->pin_count > 0)
              amdgpu_bo_subtract_pin_size(bo);
 
      if (bo->kfd_bo)

Any feedback?

Quoted 8 lines

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

#6 lore raw
In reply to a message not in the archive

Am 23.07.2018 um 18:50 schrieb Michel Dänzer:

Quoted 22 lines · Michel Dänzer
Quoted 21 lines

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index b12526ce1a9d..3010f0136de9 100644
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
  	struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
  	struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) · line 95

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
-	if (WARN_ON_ONCE(bo->pin_count > 0))
+	if (bo->pin_count > 0)
  		amdgpu_bo_subtract_pin_size(bo);
 
  	if (bo->kfd_bo)

Any feedback?

I'm a bit torn on that. On the one hand the backtrace at this point is not very useful, but on the other hand it would still be nice to have a warning.

Maybe reduce it to a DRM_ERROR()?

Christian.

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

A message that is not in the archive (sent off-list or not yet received): 65ff93cf-7f67-7d12-d77e-c2e39317a94c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#8 lore raw
Quoted 31 lines · Christian König

Am 23.07.2018 um 18:50 schrieb Michel Dänzer:

Quoted 14 lines · Michel Dänzer
Quoted 13 lines

From: Michel Dänzer <[email protected]>

The warning turned out to be not so useful, as BO destruction tends to be deferred to a workqueue.

Also, we should be preventing any damage from this now, so not really important anymore to fix code doing this.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index b12526ce1a9d..3010f0136de9 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static void amdgpu_ttm_bo_destroy(struct · line 95

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -0
@@ -89,7 +89,7 @@ static void amdgpu_ttm_bo_destroy(struct
 ttm_buffer_object *tbo)
       struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
       struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
   -    if (WARN_ON_ONCE(bo->pin_count > 0))
+    if (bo->pin_count > 0)
           amdgpu_bo_subtract_pin_size(bo);
         if (bo->kfd_bo)

Any feedback?

Quoted 5 lines

I'm a bit torn on that. On the one hand the backtrace at this point is not very useful, but on the other hand it would still be nice to have a warning.

Maybe reduce it to a DRM_ERROR()?

I don't see that being useful; we'd still get reports about the errors, but couldn't do anything about them.

Anyway, since the patch was on the list since last Thursday, I pushed it this morning with Alex's review (thanks!).

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx