All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Philip Yang <Philip.Yang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: christian.koenig@amd.com
Subject: Re: [PATCH 3/4] drm/amdgpu: Signal page table fence after gfx vm flush
Date: Thu, 1 Jun 2023 16:37:54 -0400	[thread overview]
Message-ID: <9265d40d-8f81-e64d-8da9-dc15c9951be2@amd.com> (raw)
In-Reply-To: <20230601193117.13143-4-Philip.Yang@amd.com>


On 2023-06-01 15:31, Philip Yang wrote:
> To free page table BOs which are fenced and freed when updating page
> table.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> index e0d3e3aa2e31..10d63256d26b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> @@ -219,6 +219,13 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
>   			amdgpu_ring_undo(ring);
>   			return r;
>   		}
> +
> +		if (vm) {
> +			/* Signal fence to free page table BO */
> +			dma_fence_signal(vm->pt_fence);
> +			dma_fence_put(vm->pt_fence);
> +			vm->pt_fence = amdgpu_pt_fence_create();
> +		}

I think this is too early. The TLB flush is not done at this point, it's 
only been emitted to the ring but not executed yet. You probably need to 
signal the PT fence in a fence callback from the fence "f" that signals 
when the IB completes.

Regards,
   Felix


>   	}
>   
>   	amdgpu_ring_ib_begin(ring);

  reply	other threads:[~2023-06-01 20:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 19:31 [PATCH 0/4] Page table fence Philip Yang
2023-06-01 19:31 ` [PATCH 1/4] drm/amdgpu: Implement page table BO fence Philip Yang
2023-06-01 20:12   ` Felix Kuehling
2023-06-02 11:54   ` Christian König
2023-06-01 19:31 ` [PATCH 2/4] drm/amdkfd: Signal page table fence after KFD flush tlb Philip Yang
2023-06-01 20:34   ` Felix Kuehling
2023-06-02 11:57   ` Christian König
2023-06-02 14:54     ` Felix Kuehling
2023-06-05 15:13       ` Shashank Sharma
2023-06-05 15:18         ` Christian König
2023-06-05 15:40           ` Shashank Sharma
2023-06-05 15:47             ` Christian König
2023-06-06 16:16               ` Philip Yang
2023-06-01 19:31 ` [PATCH 3/4] drm/amdgpu: Signal page table fence after gfx vm flush Philip Yang
2023-06-01 20:37   ` Felix Kuehling [this message]
2023-06-01 19:31 ` [PATCH 4/4] drm/amdgpu: Add fence to the freed page table BOs Philip Yang

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=9265d40d-8f81-e64d-8da9-dc15c9951be2@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@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 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.