From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Felix Kuehling <felix.kuehling@amd.com>,
amd-gfx@lists.freedesktop.org, philip.yang@amd.com,
Alex.Sierra@amd.com
Subject: Re: [PATCH 5/5] drm/amdgpu: immedially invalidate PTEs
Date: Thu, 12 Dec 2019 09:51:38 +0100 [thread overview]
Message-ID: <98ce952f-f52d-bf60-00b3-d984b7c2184d@gmail.com> (raw)
In-Reply-To: <afc4a884-dc56-867e-580c-7845e7de2257@amd.com>
Hi Felix,
yeah, I've also found a corner case which would raise a warning now.
Need to rework how dependencies for the PTE update are generated.
Going to take care of this in the next few days,
Christian.
Am 12.12.19 um 01:20 schrieb Felix Kuehling:
> Hi Christian,
>
> Alex started trying to invalidate PTEs in the MMU notifiers and we're
> finding that we still need to reserve the VM reservation for
> amdgpu_sync_resv in amdgpu_vm_sdma_prepare. Is that sync_resv still
> needed now, given that VM fences aren't in that reservation object any
> more?
>
> Regards,
> Felix
>
> On 2019-12-05 5:39, Christian König wrote:
>> When a BO is evicted immedially invalidate the mapped PTEs.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 ++++++++++++++++-
>> 1 file changed, 16 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 839d6df394fc..e578113bfd55 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -2565,6 +2565,7 @@ void amdgpu_vm_bo_invalidate(struct
>> amdgpu_device *adev,
>> struct amdgpu_bo *bo, bool evicted)
>> {
>> struct amdgpu_vm_bo_base *bo_base;
>> + int r;
>> /* shadow bo doesn't have bo base, its validation needs its
>> parent */
>> if (bo->parent && bo->parent->shadow == bo)
>> @@ -2572,8 +2573,22 @@ void amdgpu_vm_bo_invalidate(struct
>> amdgpu_device *adev,
>> for (bo_base = bo->vm_bo; bo_base; bo_base = bo_base->next) {
>> struct amdgpu_vm *vm = bo_base->vm;
>> + struct dma_resv *resv = vm->root.base.bo->tbo.base.resv;
>> +
>> + if (bo->tbo.type != ttm_bo_type_kernel) {
>> + struct amdgpu_bo_va *bo_va;
>> +
>> + bo_va = container_of(bo_base, struct amdgpu_bo_va,
>> + base);
>> + r = amdgpu_vm_bo_update(adev, bo_va,
>> + bo->tbo.base.resv != resv);
>> + if (!r) {
>> + amdgpu_vm_bo_idle(bo_base);
>> + continue;
>> + }
>> + }
>> - if (evicted && bo->tbo.base.resv ==
>> vm->root.base.bo->tbo.base.resv) {
>> + if (evicted && bo->tbo.base.resv == resv) {
>> amdgpu_vm_bo_evicted(bo_base);
>> continue;
>> }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2019-12-12 8:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 13:39 [PATCH 1/5] drm/amdgpu: move VM eviction decision into amdgpu_vm.c Christian König
2019-12-05 13:39 ` [PATCH 2/5] drm/amdgpu: explicitely sync to VM updates v2 Christian König
2019-12-05 16:34 ` Felix Kuehling
2019-12-05 13:39 ` [PATCH 3/5] drm/amdgpu: stop adding VM updates fences to the resv obj Christian König
2019-12-05 16:43 ` Felix Kuehling
2019-12-05 13:39 ` [PATCH 4/5] drm/amdgpu: add VM eviction lock v2 Christian König
2019-12-05 16:33 ` Felix Kuehling
2019-12-05 13:39 ` [PATCH 5/5] drm/amdgpu: immedially invalidate PTEs Christian König
2019-12-05 16:45 ` Felix Kuehling
2019-12-05 17:15 ` Christian König
2019-12-12 0:20 ` Felix Kuehling
2019-12-12 8:51 ` Christian König [this message]
2019-12-12 14:38 ` Philip Yang
2019-12-12 15:12 ` Christian König
2020-01-03 4:20 ` Sierra Guiza, Alejandro (Alex)
2020-01-04 16:03 ` Christian König
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=98ce952f-f52d-bf60-00b3-d984b7c2184d@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Alex.Sierra@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=felix.kuehling@amd.com \
--cc=philip.yang@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