From: "Kuehling, Felix" <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
To: "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Kuehling, Felix" <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>,
"Kasiviswanathan,
Harish" <Harish.Kasiviswanathan-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 5/9] drm/amdgpu: Remove explicit wait after VM validate
Date: Tue, 6 Nov 2018 01:40:53 +0000 [thread overview]
Message-ID: <1541468434-29384-6-git-send-email-Felix.Kuehling@amd.com> (raw)
In-Reply-To: <1541468434-29384-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
PD or PT might have to be moved during validation and this move has to be
completed before updating it. If page table updates are done using SDMA
then this serializing is done by SDMA command submission.
And if PD/PT updates are done by CPU, then explicit waiting for PD/PT
updates are done in amdgpu VM amdgpu_vm_wait_pd function.
Sync to PD BO moving fence to handle corner case where none of the PTs
are updated but PD is evicted.
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 31 ++++++++++++++++++------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 9a1b2b2..e124d2d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -901,6 +901,26 @@ static int process_validate_vms(struct amdkfd_process_info *process_info)
return 0;
}
+static int process_sync_pds_resv(struct amdkfd_process_info *process_info,
+ struct amdgpu_sync *sync)
+{
+ struct amdgpu_vm *peer_vm;
+ int ret;
+
+ list_for_each_entry(peer_vm, &process_info->vm_list_head,
+ vm_list_node) {
+ struct amdgpu_bo *pd = peer_vm->root.base.bo;
+
+ ret = amdgpu_sync_resv(amdgpu_ttm_adev(pd->tbo.bdev),
+ sync, pd->tbo.resv,
+ AMDGPU_FENCE_OWNER_UNDEFINED, false);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
static int process_update_pds(struct amdkfd_process_info *process_info,
struct amdgpu_sync *sync)
{
@@ -2045,13 +2065,10 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
if (ret)
goto validate_map_fail;
- /* Wait for PD/PTs validate to finish */
- /* FIXME: I think this isn't needed */
- list_for_each_entry(peer_vm, &process_info->vm_list_head,
- vm_list_node) {
- struct amdgpu_bo *bo = peer_vm->root.base.bo;
-
- ttm_bo_wait(&bo->tbo, false, false);
+ ret = process_sync_pds_resv(process_info, &sync_obj);
+ if (ret) {
+ pr_debug("Memory eviction: Failed to sync to PD BO moving fence. Try again\n");
+ goto validate_map_fail;
}
/* Validate BOs and map them to GPUVM (update VM page tables). */
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-11-06 1:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 1:40 [PATCH 0/9] KFD upstreaming Nov 2018, part 1 Kuehling, Felix
[not found] ` <1541468434-29384-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 1:40 ` [PATCH 1/9] drm/amdkfd: Replace mqd with mqd_mgr as the variable name for mqd_manager Kuehling, Felix
[not found] ` <1541468434-29384-2-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:32 ` Alex Deucher
2018-11-06 1:40 ` [PATCH 2/9] drm/amdkfd: Added Vega12 and Polaris12 for KFD Kuehling, Felix
[not found] ` <1541468434-29384-3-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:33 ` Alex Deucher
2018-11-06 1:40 ` [PATCH 3/9] drm/amdkfd: Adjust the debug message in KFD ISR Kuehling, Felix
[not found] ` <1541468434-29384-4-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:33 ` Alex Deucher
2018-11-06 1:40 ` [PATCH 4/9] drm/amdkfd: Workaround PASID missing in gfx9 interrupt payload under non HWS Kuehling, Felix
[not found] ` <1541468434-29384-5-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:34 ` Alex Deucher
2018-11-06 1:40 ` Kuehling, Felix [this message]
[not found] ` <1541468434-29384-6-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:35 ` [PATCH 5/9] drm/amdgpu: Remove explicit wait after VM validate Alex Deucher
2018-11-06 1:40 ` [PATCH 7/9] drm/amdkfd: Fix and simplify sync object handling for KFD Kuehling, Felix
[not found] ` <1541468434-29384-8-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-16 20:19 ` Kuehling, Felix
[not found] ` <972bbc9e-8f5d-9740-f400-4e1211e8e00f-5C7GfCeVMHo@public.gmane.org>
2018-11-17 16:01 ` Koenig, Christian
2018-11-06 1:40 ` [PATCH 6/9] drm/amdgpu: KFD Restore process: Optimize waiting Kuehling, Felix
[not found] ` <1541468434-29384-7-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-11-06 21:36 ` Alex Deucher
2018-11-06 1:40 ` [PATCH 8/9] drm/amdgpu: Fix KFD doorbell SG BO mapping Kuehling, Felix
2018-11-06 1:40 ` [PATCH 9/9] drm/amdkfd: change system memory overcommit limit Kuehling, Felix
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=1541468434-29384-6-git-send-email-Felix.Kuehling@amd.com \
--to=felix.kuehling-5c7gfcevmho@public.gmane.org \
--cc=Harish.Kasiviswanathan-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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