Skip to contentSkip to conversation

drm/amdgpu: Reserve space for shared fence

PATCH In review Zeng, Oak 3 participants 3 messages Jun 11, 2019 – Jun 12, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Zeng, Oak

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Reserve space for shared fence

Call reservation_object_reserve_shared to reserve space for shared fence. Otherwise it will trigger BUG_ON condition in reservation_object_add_shared_fence.

Change-Id Ib0fae16247e33ee68f95bffa723451c0cd619344
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +4 -0
index 81e0e75..74e8695 100644
@@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
 	 * Add process eviction fence to bo so they can
 	 * evict each other.
 	 */
+	ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
+	if (ret)
+		goto reserve_shared_fail;
 	amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
 	amdgpu_bo_unreserve(gws_bo);
 	mutex_unlock(&(*mem)->process_info->lock);
 
 	return ret;
 
+reserve_shared_fail:
 bo_validation_failure:
 	amdgpu_bo_unreserve(gws_bo);
 bo_reservation_failure:
Signature · 6 lines
2.7.4

_______________________________________________
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): 1560270022-4934-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 11.06.19 um 18:20 schrieb Zeng, Oak:

Quoted 6 lines

Call reservation_object_reserve_shared to reserve space for shared fence. Otherwise it will trigger BUG_ON condition in reservation_object_add_shared_fence.

Change-Id Ib0fae16247e33ee68f95bffa723451c0cd619344
Quoted 15 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +3 -0
index 81e0e75..74e8695 100644
@@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
  	 * Add process eviction fence to bo so they can
  	 * evict each other.
  	 */
+	ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
+	if (ret)
+		goto reserve_shared_fail;

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem · line 2167

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -0
  	amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
  	amdgpu_bo_unreserve(gws_bo);
  	mutex_unlock(&(*mem)->process_info->lock);
 
  	return ret;
 
+reserve_shared_fail:
  bo_validation_failure:
  	amdgpu_bo_unreserve(gws_bo);
  bo_reservation_failure:

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

Reviewed-by Felix Kuehling
#3 lore raw
In reply to a message not in the archive
Quoted 6 lines · Oak

Call reservation_object_reserve_shared to reserve space for shared fence. Otherwise it will trigger BUG_ON condition in reservation_object_add_shared_fence.

Change-Id Ib0fae16247e33ee68f95bffa723451c0cd619344
Quoted 15 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +3 -0
index 81e0e75..74e8695 100644
@@ -2152,12 +2152,16 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
  	 * Add process eviction fence to bo so they can
  	 * evict each other.
  	 */
+	ret = reservation_object_reserve_shared(gws_bo->tbo.resv, 1);
+	if (ret)
+		goto reserve_shared_fail;

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem · line 2167

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -0
  	amdgpu_bo_fence(gws_bo, &process_info->eviction_fence->base, true);
  	amdgpu_bo_unreserve(gws_bo);
  	mutex_unlock(&(*mem)->process_info->lock);
 
  	return ret;
 
+reserve_shared_fail:
  bo_validation_failure:
  	amdgpu_bo_unreserve(gws_bo);
  bo_reservation_failure:

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