All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/2] libdrm: fix inefficient vamgr algorithm
@ 2018-01-12  5:45 Chunming Zhou
       [not found] ` <20180112054554.19585-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Chunming Zhou @ 2018-01-12  5:45 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Chunming Zhou, Hui.Deng-5C7GfCeVMHo

issue: UMD allocates top 4GB, but don't do anything, just reserve top 4GB space,
but the performance of VP13 drops from 162fps to 99fps.

root cause:
our va hole list of vamgr is too long by time going.

fix:
reusing old hole as much as possible can make the list shortest.

result:
performance recovers as non-list path, next patch will remove non-list code path.

Change-Id: I3f00ef193815d31a78d416b53c1511098b88da8f
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 amdgpu/amdgpu_vamgr.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 6e0d7e37..66bb8ecd 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -94,9 +94,7 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
 		return AMDGPU_INVALID_VA_ADDRESS;
 
 	pthread_mutex_lock(&mgr->bo_va_mutex);
-	/* TODO: using more appropriate way to track the holes */
-	/* first look for a hole */
-	LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
+	LIST_FOR_EACH_ENTRY_SAFE_REV(hole, n, &mgr->va_holes, list) {
 		if (base_required) {
 			if(hole->offset > base_required ||
 				(hole->offset + hole->size) < (base_required + size))
@@ -183,9 +181,7 @@ static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
 	size = ALIGN(size, mgr->va_alignment);
 
 	pthread_mutex_lock(&mgr->bo_va_mutex);
-	/* TODO: using more appropriate way to track the holes */
-	/* first look for a hole */
-	LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
+	LIST_FOR_EACH_ENTRY_SAFE_REV(hole, n, &mgr->va_holes, list) {
 		if (hole->offset > range_max ||
 			hole->offset + hole->size < range_min ||
 			(hole->offset > range_min && hole->offset + size > range_max) ||
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-26  3:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12  5:45 [PATCH libdrm 1/2] libdrm: fix inefficient vamgr algorithm Chunming Zhou
     [not found] ` <20180112054554.19585-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-01-12  5:45   ` [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr Chunming Zhou
     [not found]     ` <20180112054554.19585-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-01-12  8:04       ` Christian König
     [not found]         ` <563c031e-2e11-eb51-bdce-589da435c9a8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-12  8:17           ` Chunming Zhou
2018-02-08  9:01       ` Michel Dänzer
     [not found]         ` <e3722edc-8ca4-4730-d649-2b5a959b92c1-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-02-08  9:13           ` Chunming Zhou
     [not found]             ` <4a2036e5-820f-d62a-a773-2da1f575e1bc-5C7GfCeVMHo@public.gmane.org>
2018-02-09  6:01               ` Chunming Zhou
     [not found]                 ` <c6b30b81-8b6f-3b5a-5654-e8075939143e-5C7GfCeVMHo@public.gmane.org>
2018-02-09  8:58                   ` Michel Dänzer
     [not found]                     ` <c7eaf026-f0f5-fab3-4bab-c11b39701e6a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-02-18  8:41                       ` Andrey Grodzovsky
     [not found]                         ` <881720e0-3225-dd36-23f7-146b9bfb919d-5C7GfCeVMHo@public.gmane.org>
2018-02-19  7:25                           ` Andrey Grodzovsky
     [not found]                             ` <dcb5a4b1-f959-107b-d4af-18758fbf74cd-5C7GfCeVMHo@public.gmane.org>
2018-02-19  7:50                               ` Christian König
     [not found]                                 ` <032f5418-4b01-f269-7e0a-5e1dcad65e10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-26  3:21                                   ` Chunming Zhou

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.