aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-08-26 02:43:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 14:53:20 -0400
commita2f14820e3493145c25095873d4a510a1b25efdc (patch)
tree801651223be96004fc4f39ef658c3bd282311ca2 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent5d86b2c391965cbcb295e8fa795276977b2a416e (diff)
drm/amdgpu: Track pending retry faults in IH and VM (v2)
IH tracks pending retry faults in a hash table for fast lookup in interrupt context. Each VM has a short FIFO of pending VM faults for processing in a bottom half. The IH prescreening stage adds retry faults and filters out repeated retry interrupts to minimize the impact of interrupt storms. It's the VM's responsibility remove pending faults once they are handled. For now this is only done when the VM is destroyed. v2: - Made the hash table smaller and the FIFO longer. I never want the FIFO to fill up, because that would make prescreen take longer. 128 pending page faults should be enough to keep migrations busy. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Christian König <christian.koenig@amd.com> (v1) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9b795915cab1..6c1133298b17 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2680,6 +2680,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
2680 vm->pasid = pasid; 2680 vm->pasid = pasid;
2681 } 2681 }
2682 2682
2683 INIT_KFIFO(vm->faults);
2684
2683 return 0; 2685 return 0;
2684 2686
2685error_free_root: 2687error_free_root:
@@ -2731,8 +2733,13 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
2731{ 2733{
2732 struct amdgpu_bo_va_mapping *mapping, *tmp; 2734 struct amdgpu_bo_va_mapping *mapping, *tmp;
2733 bool prt_fini_needed = !!adev->gart.gart_funcs->set_prt; 2735 bool prt_fini_needed = !!adev->gart.gart_funcs->set_prt;
2736 u64 fault;
2734 int i; 2737 int i;
2735 2738
2739 /* Clear pending page faults from IH when the VM is destroyed */
2740 while (kfifo_get(&vm->faults, &fault))
2741 amdgpu_ih_clear_fault(adev, fault);
2742
2736 if (vm->pasid) { 2743 if (vm->pasid) {
2737 unsigned long flags; 2744 unsigned long flags;
2738 2745