All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/amdgpu: Sync KFD fence only for move/evict
@ 2017-10-20 22:07 Harish Kasiviswanathan
       [not found] ` <1508537231-19169-1-git-send-email-Harish.Kasiviswanathan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Harish Kasiviswanathan @ 2017-10-20 22:07 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Harish Kasiviswanathan

A single KFD eviction fence is attached to all the BOs of a process
including BOs imported. This fence ensures that all BOs belonging to
that process stays resident when the process queues are active.

Don't add this eviction fence to any sync object unless it is a move or
evict job. These jobs are identified by the fence owner
AMDGPU_FENCE_OWNER_UNDEFINED

v2: Always sync to exclusive fence
v3: avoid unncessary diverge from amd-staging-drm-next

Change-Id: I8752d1cf6b2a1c4f2a57292b7c2cd308d5b6f9b7
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
index a4f0ecf..4159e6b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
@@ -198,11 +198,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
 	if (resv == NULL)
 		return -EINVAL;
 
+	/* always sync to the exclusive fence */
 	f = reservation_object_get_excl(resv);
-	fence_owner = amdgpu_sync_get_owner(f);
-	if (fence_owner != AMDGPU_FENCE_OWNER_KFD ||
-			owner != AMDGPU_FENCE_OWNER_VM)
-		r = amdgpu_sync_fence(adev, sync, f);
+	r = amdgpu_sync_fence(adev, sync, f);
 
 	if (explicit_sync)
 		return r;
@@ -216,7 +214,7 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
 					      reservation_object_held(resv));
 		fence_owner = amdgpu_sync_get_owner(f);
 		if (fence_owner == AMDGPU_FENCE_OWNER_KFD &&
-				owner == AMDGPU_FENCE_OWNER_VM)
+		    owner != AMDGPU_FENCE_OWNER_UNDEFINED)
 			continue;
 
 		if (amdgpu_sync_same_dev(adev, f)) {
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH v3] drm/amdgpu: Sync KFD fence only for move/evict
       [not found] ` <1508537231-19169-1-git-send-email-Harish.Kasiviswanathan-5C7GfCeVMHo@public.gmane.org>
@ 2017-10-21 21:41   ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2017-10-21 21:41 UTC (permalink / raw)
  To: Harish Kasiviswanathan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 21.10.2017 um 00:07 schrieb Harish Kasiviswanathan:
> A single KFD eviction fence is attached to all the BOs of a process
> including BOs imported. This fence ensures that all BOs belonging to
> that process stays resident when the process queues are active.
>
> Don't add this eviction fence to any sync object unless it is a move or
> evict job. These jobs are identified by the fence owner
> AMDGPU_FENCE_OWNER_UNDEFINED
>
> v2: Always sync to exclusive fence
> v3: avoid unncessary diverge from amd-staging-drm-next
>
> Change-Id: I8752d1cf6b2a1c4f2a57292b7c2cd308d5b6f9b7
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
> index a4f0ecf..4159e6b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
> @@ -198,11 +198,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
>   	if (resv == NULL)
>   		return -EINVAL;
>   
> +	/* always sync to the exclusive fence */
>   	f = reservation_object_get_excl(resv);
> -	fence_owner = amdgpu_sync_get_owner(f);
> -	if (fence_owner != AMDGPU_FENCE_OWNER_KFD ||
> -			owner != AMDGPU_FENCE_OWNER_VM)
> -		r = amdgpu_sync_fence(adev, sync, f);
> +	r = amdgpu_sync_fence(adev, sync, f);
>   
>   	if (explicit_sync)
>   		return r;
> @@ -216,7 +214,7 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
>   					      reservation_object_held(resv));
>   		fence_owner = amdgpu_sync_get_owner(f);
>   		if (fence_owner == AMDGPU_FENCE_OWNER_KFD &&
> -				owner == AMDGPU_FENCE_OWNER_VM)
> +		    owner != AMDGPU_FENCE_OWNER_UNDEFINED)
>   			continue;
>   
>   		if (amdgpu_sync_same_dev(adev, f)) {


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-10-21 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 22:07 [PATCH v3] drm/amdgpu: Sync KFD fence only for move/evict Harish Kasiviswanathan
     [not found] ` <1508537231-19169-1-git-send-email-Harish.Kasiviswanathan-5C7GfCeVMHo@public.gmane.org>
2017-10-21 21:41   ` Christian König

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.