AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix huge page handling on Vega10
@ 2018-11-12 17:09 Christian König
       [not found] ` <20181112170942.10674-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2018-11-12 17:09 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

We accidentially set the huge flag on the parent instead of the childs.
This caused some VM faults under memory pressure.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 352b30409060..dad0e2342df9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1632,13 +1632,6 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
 			continue;
 		}
 
-		/* First check if the entry is already handled */
-		if (cursor.pfn < frag_start) {
-			cursor.entry->huge = true;
-			amdgpu_vm_pt_next(adev, &cursor);
-			continue;
-		}
-
 		/* If it isn't already handled it can't be a huge page */
 		if (cursor.entry->huge) {
 			/* Add the entry to the relocated list to update it. */
@@ -1701,8 +1694,17 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
 			}
 		} while (frag_start < entry_end);
 
-		if (frag >= shift)
+		if (amdgpu_vm_pt_descendant(adev, &cursor)) {
+			/* Mark all child entries as huge */
+			while (cursor.pfn < frag_start) {
+				cursor.entry->huge = true;
+				amdgpu_vm_pt_next(adev, &cursor);
+			}
+
+		} else if (frag >= shift) {
+			/* or just move on to the next on the same level. */
 			amdgpu_vm_pt_next(adev, &cursor);
+		}
 	}
 
 	return 0;
-- 
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] 7+ messages in thread

end of thread, other threads:[~2018-11-13  9:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-12 17:09 [PATCH] drm/amdgpu: fix huge page handling on Vega10 Christian König
     [not found] ` <20181112170942.10674-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-12 17:16   ` Alex Deucher
     [not found]     ` <CADnq5_MORq4h3zMq_YF+_8HjMyqn61AweLxwYfr+oo4kfkxdfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-12 21:45       ` Samuel Pitoiset
     [not found]         ` <f460f333-e31c-2347-4d96-dd04d7416451-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-13  8:14           ` Christian König
     [not found]             ` <34255c9f-b167-f8bc-7ce9-e1e75123cef4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-13  9:08               ` Samuel Pitoiset
2018-11-12 23:50   ` Kuehling, Felix
     [not found]     ` <076d08d0-bdf8-4c59-88aa-0d45383e66cb-5C7GfCeVMHo@public.gmane.org>
2018-11-13  7:47       ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox