From: Chunming Zhou <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: "Christian König"
<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 3/3] drm/amdgpu: re-validate per VM BOs if required v2
Date: Tue, 27 Mar 2018 18:16:54 +0800 [thread overview]
Message-ID: <20180327101654.1118-3-david1.zhou@amd.com> (raw)
In-Reply-To: <20180327101654.1118-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
From: Christian König <ckoenig.leichtzumerken@gmail.com>
If a per VM BO ends up in a allowed domain it never moves back into the
prefered domain.
v2: move to refresh function, the validation order also keeps same as lru
Change-Id: Ifb3e561785d3b464da28c439b271c26825224c5e
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Chunming Zhou <david1.zhou@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 8ad2bb705765..f28a94f3d687 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1914,6 +1914,13 @@ void amdgpu_vm_refresh_lru(struct amdgpu_device *adev, struct amdgpu_vm *vm)
if (bo_base->bo->shadow)
ttm_bo_move_to_lru_tail(&bo_base->bo->shadow->tbo);
spin_unlock(&glob->lru_lock);
+ /* If the BO prefers to be in VRAM, but currently isn't add it
+ * back to the evicted list so that it gets validated again on
+ * the next command submission.
+ */
+ if (bo_base->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM &&
+ bo_base->bo->tbo.mem.mem_type != TTM_PL_VRAM)
+ list_move_tail(&bo_base->vm_status, &vm->evicted);
}
spin_unlock(&vm->status_lock);
}
--
2.14.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-03-27 10:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 10:16 [PATCH 1/3] drm/amdgpu: make all per vm BOs list Chunming Zhou
[not found] ` <20180327101654.1118-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-03-27 10:16 ` [PATCH 2/3] drm/amdgpu: refresh per vm bo lru Chunming Zhou
[not found] ` <20180327101654.1118-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-03-27 10:50 ` Christian König
[not found] ` <6afa6cca-d59c-9e64-f891-c43a741069d4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-27 11:56 ` Zhou, David(ChunMing)
2018-03-27 13:44 ` Christian König
[not found] ` <a9d42a8a-b9b5-1d89-f95e-e678829a8260-5C7GfCeVMHo@public.gmane.org>
2018-03-28 8:13 ` zhoucm1
2018-03-29 8:37 ` zhoucm1
[not found] ` <14672700-82d7-c9d8-1086-84a4d8a711bc-5C7GfCeVMHo@public.gmane.org>
2018-03-29 8:59 ` Christian König
[not found] ` <d7dad640-edd0-5aa3-9165-b19d44525a5b-5C7GfCeVMHo@public.gmane.org>
2018-03-29 12:46 ` Chunming Zhou
2018-03-27 10:16 ` Chunming Zhou [this message]
2018-03-27 10:52 ` [PATCH 1/3] drm/amdgpu: make all per vm BOs list 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=20180327101654.1118-3-david1.zhou@amd.com \
--to=david1.zhou-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
--cc=ckoenig.leichtzumerken-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