AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: xinhui pan <xinhui.pan@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>
Subject: Re: [PATCH 1/2] drm//amdgpu: Always sync fence before unlock eviction_lock
Date: Fri, 13 Mar 2020 09:52:20 +0100	[thread overview]
Message-ID: <91022e2e-67fb-ef65-09d6-2814b10493d8@amd.com> (raw)
In-Reply-To: <20200313074336.19545-2-xinhui.pan@amd.com>

Am 13.03.20 um 08:43 schrieb xinhui pan:
> The fence generated in ->commit is a shared one, so add it to resv.
> And we need do that with eviction lock hold.
>
> Currently we only sync last_direct/last_delayed before ->prepare. But we
> fail to sync the last fence generated by ->commit. That cuases problems
> if eviction happenes later, but it does not sync the last fence.

NAK, that won't work.

We can only add fences when the dma_resv object is locked and that is 
only the case when validating.

I'm considering to just partially revert the patch originally stopping 
to add fences and instead only not add them when invalidating in a 
direct submit.

Christian.

>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Felix Kuehling <Felix.Kuehling@amd.com>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 73398831196f..f424b5969930 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1582,6 +1582,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   	struct amdgpu_vm_update_params params;
>   	enum amdgpu_sync_mode sync_mode;
>   	int r;
> +	struct amdgpu_bo *root = vm->root.base.bo;
>   
>   	memset(&params, 0, sizeof(params));
>   	params.adev = adev;
> @@ -1604,8 +1605,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   	}
>   
>   	if (flags & AMDGPU_PTE_VALID) {
> -		struct amdgpu_bo *root = vm->root.base.bo;
> -
>   		if (!dma_fence_is_signaled(vm->last_direct))
>   			amdgpu_bo_fence(root, vm->last_direct, true);
>   
> @@ -1623,6 +1622,12 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   
>   	r = vm->update_funcs->commit(&params, fence);
>   
> +	if (!dma_fence_is_signaled(vm->last_direct))
> +		amdgpu_bo_fence(root, vm->last_direct, true);
> +
> +	if (!dma_fence_is_signaled(vm->last_delayed))
> +		amdgpu_bo_fence(root, vm->last_delayed, true);
> +
>   error_unlock:
>   	amdgpu_vm_eviction_unlock(vm);
>   	return r;

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

  reply	other threads:[~2020-03-13  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  7:43 [PATCH 0/2] fix gmc page fault on navi1X xinhui pan
2020-03-13  7:43 ` [PATCH 1/2] drm//amdgpu: Always sync fence before unlock eviction_lock xinhui pan
2020-03-13  8:52   ` Christian König [this message]
2020-03-13  9:29     ` Pan, Xinhui
2020-03-13  9:55       ` Christian König
2020-03-13 10:21         ` Pan, Xinhui
2020-03-13 10:23           ` Christian König
2020-03-13 10:40             ` Pan, Xinhui
2020-03-13 10:44               ` Christian König
2020-03-13  7:43 ` [PATCH 2/2] drm/amdgpu: unref the bo after job submit xinhui pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91022e2e-67fb-ef65-09d6-2814b10493d8@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=xinhui.pan@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox