Skip to contentSkip to conversation

drm/amdgpu: Fix IB allocation sizes for page table updates

PATCH In review Felix Kuehling 3 participants 4 messages Aug 30, 2017 – Aug 31, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix IB allocation sizes for page table updates

set_pte_pde commands need 10 dwords.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -2
index 4cdfb70..587a166 100644
@@ -1037,7 +1037,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
 		ndw = 64;
 
 		/* assume the worst case */
-		ndw += parent->last_entry_used * 6;
+		ndw += parent->last_entry_used * 10;
 
 		pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 
@@ -1545,7 +1545,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	ndw = 64;
 
 	/* one PDE write for each huge page */
-	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 10;
 
 	if (src) {
 		/* only copy commands needed */
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1504127327-446-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 3 lines · Felix Kuehling

set_pte_pde commands need 10 dwords.

Quoted 29 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -3
index 4cdfb70..587a166 100644
@@ -1037,7 +1037,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
                ndw = 64;
 
                /* assume the worst case */
-               ndw += parent->last_entry_used * 6;
+               ndw += parent->last_entry_used * 10;
 
                pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 
@@ -1545,7 +1545,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
        ndw = 64;
 
        /* one PDE write for each huge page */
-       ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+       ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 10;
 
        if (src) {
                /* only copy commands needed */
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive

Am 30.08.2017 um 23:08 schrieb Felix Kuehling:

Quoted 1 line

set_pte_pde commands need 10 dwords.

But is only used when we write more than 3 consecutive entries, before that we use write_pte which uses only 6 dw.

See amdgpu_vm_do_set_ptes() in amdgpu_vm.c

Regards,
Christian.

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 4cdfb70..587a166 100644
@@ -1037,7 +1037,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
  		ndw = 64;
 
  		/* assume the worst case */
-		ndw += parent->last_entry_used * 6;
+		ndw += parent->last_entry_used * 10;
 
  		pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1551

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -1545,7 +1545,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
  	ndw = 64;
 
  	/* one PDE write for each huge page */
-	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 10;
 
  	if (src) {
  		/* only copy commands needed */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 51a039bc-e203-9708-6d53-419d34f81dd9-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#5 lore raw

Yeah, I realized this later last night. I'm going to do some more debugging to track down the real problem today.

For now, this seems to have moved around IB allocations enough to hide the problem so our merge today seems to have passed PSDB. But like I said, at best I've hidden the problem, not fixed it.

Regards,
Felix
________________________________________
From: Christian König <[email protected]>
Sent: Thursday, August 31, 2017 3:06:37 AM
To: Kuehling, Felix; [email protected]
Subject: Re: [PATCH 1/1] drm/amdgpu: Fix IB allocation sizes for page table updates

Am 30.08.2017 um 23:08 schrieb Felix Kuehling:

Quoted 1 line

set_pte_pde commands need 10 dwords.

But is only used when we write more than 3 consecutive entries, before that we use write_pte which uses only 6 dw.

See amdgpu_vm_do_set_ptes() in amdgpu_vm.c

Regards,
Christian.

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 4cdfb70..587a166 100644
@@ -1037,7 +1037,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
              ndw = 64;
 
              /* assume the worst case */
-             ndw += parent->last_entry_used * 6;
+             ndw += parent->last_entry_used * 10;
 
              pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1551

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -1545,7 +1545,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
      ndw = 64;
 
      /* one PDE write for each huge page */
-     ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+     ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 10;
 
      if (src) {
              /* only copy commands needed */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx