回复: [PATCH 1/3] drm/amdgpu: check flush fence context instead of same ring v2

Zhou, David(ChunMing) David1.Zhou at amd.com
Wed Jul 13 12:14:58 UTC 2016


make sense

Sent from my Huawei Mobile

-------- ԭʼÓʼþ --------
Ö÷Ì⣺Re: [PATCH 1/3] drm/amdgpu: check flush fence context instead of same ring v2
·¢¼þÈË£º"StDenis, Tom"
ÊÕ¼þÈË£º"Zhou, David(ChunMing)" ,Christian König ,amd-gfx at lists.freedesktop.org
³­ËÍ£º


Just to add to that I had no more GPU hangs with those patches on my CZ system.


Tom


________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of zhoucm1 <david1.zhou at amd.com>
Sent: Tuesday, July 12, 2016 21:52
To: Christian K?nig; amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/amdgpu: check flush fence context instead of same ring v2



On 2016Äê07ÔÂ12ÈÕ 20:05, Christian K?nig wrote:
> From: Christian K?nig <christian.koenig at amd.com>
>
> Otherwise we can run into the following situation:
>
> 1. Process A grabs ID 1 for ring 0.
> 2. Process B grabs ID 1 for ring 0.
> 3. Process A grabs ID 1 for ring 1.
> 4. Process A tries to reuse ID1 for ring 0 but things he doesn't need to flush.
>
> v2: check the context of the flush fence instead of messing with the owner field.
>
> Signed-off-by: Christian K?nig <christian.koenig at amd.com>

The set is Reviewed-by: Chunming Zhou <david1.zhou at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index f8615a4..57337d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -185,6 +185,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
>                      struct amdgpu_job *job)
>   {
>        struct amdgpu_device *adev = ring->adev;
> +     uint64_t fence_context = adev->fence_context + ring->idx;
>        struct fence *updates = sync->last_vm_update;
>        struct amdgpu_vm_id *id, *idle;
>        struct fence **fences;
> @@ -244,7 +245,6 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
>        i = ring->idx;
>        do {
>                struct fence *flushed;
> -             bool same_ring = ring->idx == i;
>
>                id = vm->ids[i++];
>                if (i == AMDGPU_MAX_RINGS)
> @@ -262,8 +262,11 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
>                if (job->vm_pd_addr != id->pd_gpu_addr)
>                        continue;
>
> -             if (!same_ring &&
> -                 (!id->last_flush || !fence_is_signaled(id->last_flush)))
> +             if (!id->last_flush)
> +                     continue;
> +
> +             if (id->last_flush->context != fence_context &&
> +                 !fence_is_signaled(id->last_flush))
>                        continue;
>
>                flushed  = id->flushed_updates;

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160713/81bfba69/attachment.html>


More information about the amd-gfx mailing list