All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: partially revert "svm bo enable_signal call condition"
@ 2021-11-22 12:39 Christian König
  2021-11-22 16:52 ` Felix Kuehling
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2021-11-22 12:39 UTC (permalink / raw)
  To: felix.kuehling, alex.sierra, philip.yang, amd-gfx

Partially revert commit 5f319c5c21b5909abb43d8aadc92a8aa549ee443.

First of all this is illegal use of RCU to call dma_fence_enable_sw_signaling()
since we don't hold a reference to the fence in question and can crash badly.

Then the code doesn't seem to have the intended effect since only the
exclusive fence is handled, but the KFD fences are always added as shared fence.

Only keep the handling to throw away the content of SVM BOs.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 30b7dde496fc..b9cd32d25bc0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -113,17 +113,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
 
 	abo = ttm_to_amdgpu_bo(bo);
 	if (abo->flags & AMDGPU_AMDKFD_CREATE_SVM_BO) {
-		struct dma_fence *fence;
-		struct dma_resv *resv = &bo->base._resv;
-
-		rcu_read_lock();
-		fence = rcu_dereference(resv->fence_excl);
-		if (fence && !fence->ops->signaled)
-			dma_fence_enable_sw_signaling(fence);
-
 		placement->num_placement = 0;
 		placement->num_busy_placement = 0;
-		rcu_read_unlock();
 		return;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: partially revert "svm bo enable_signal call condition"
  2021-11-22 12:39 [PATCH] drm/amdgpu: partially revert "svm bo enable_signal call condition" Christian König
@ 2021-11-22 16:52 ` Felix Kuehling
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Kuehling @ 2021-11-22 16:52 UTC (permalink / raw)
  To: Christian König, alex.sierra, philip.yang, amd-gfx

Am 2021-11-22 um 7:39 a.m. schrieb Christian König:
> Partially revert commit 5f319c5c21b5909abb43d8aadc92a8aa549ee443.
>
> First of all this is illegal use of RCU to call dma_fence_enable_sw_signaling()
> since we don't hold a reference to the fence in question and can crash badly.
>
> Then the code doesn't seem to have the intended effect since only the
> exclusive fence is handled, but the KFD fences are always added as shared fence.
>
> Only keep the handling to throw away the content of SVM BOs.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 30b7dde496fc..b9cd32d25bc0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -113,17 +113,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
>  
>  	abo = ttm_to_amdgpu_bo(bo);
>  	if (abo->flags & AMDGPU_AMDKFD_CREATE_SVM_BO) {
> -		struct dma_fence *fence;
> -		struct dma_resv *resv = &bo->base._resv;
> -
> -		rcu_read_lock();
> -		fence = rcu_dereference(resv->fence_excl);
> -		if (fence && !fence->ops->signaled)
> -			dma_fence_enable_sw_signaling(fence);
> -
>  		placement->num_placement = 0;
>  		placement->num_busy_placement = 0;
> -		rcu_read_unlock();
>  		return;
>  	}
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-22 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 12:39 [PATCH] drm/amdgpu: partially revert "svm bo enable_signal call condition" Christian König
2021-11-22 16:52 ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.