drm/amdgpu: attach tlb fence to the PTs update
Subsystems (2)
PATCH 1/1 drm/amdgpu: attach tlb fence to the PTs update
Ensure the userq TLB flush is emitted only after the VM update finishes and the PT BOs have been annotated with bookkeeping fences.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -1062,7 +1062,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params, }/* Prepare a TLB flush fence to be attached to PTs */ -if (!params->unlocked && vm->is_compute_context) { +if (!params->unlocked) {amdgpu_vm_tlb_fence_create (params->adev, vm, fence);/* Makes sure no PD/PT is freed before the flush */
Signature · 1 line
2.34.1
Quoted 6 lines · Prike Liang
Ensure the userq TLB flush is emitted only after the VM update finishes and the PT BOs have been annotated with bookkeeping fences.
Suggested-by Christian König <[email protected]>Signed-off-by Prike Liang <[email protected]>
Could be that people start to complain that this results in extra overhead, but that shouldn't be much of an issue.
Regards,
Christian.
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -1062,7 +1062,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params, }/* Prepare a TLB flush fence to be attached to PTs */ -if (!params->unlocked && vm->is_compute_context) { +if (!params->unlocked) {amdgpu_vm_tlb_fence_create (params->adev, vm, fence);/* Makes sure no PD/PT is freed before the flush */
[Public]
Regards,
Prike
Quoted 13 lines
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 5, 2025 8:50 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: attach tlb fence to the PTs updateQuoted 3 lines · Prike Liang
Ensure the userq TLB flush is emitted only after the VM update finishes and the PT BOs have been annotated with bookkeeping fences.
Quoted 7 lines
Quoted 2 lines
Suggested-by Christian König <[email protected]>Signed-off-by Prike Liang <[email protected]>Reviewed-by Christian König <[email protected]>Could be that people start to complain that this results in extra overhead, but that shouldn't be much of an issue.
If without sorting the userq or KFD compute context, maybe overhead on legacy kernel queue case?
Quoted 22 lines
Regards,
Christian.drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct
Quoted 10 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -1062,7 +1062,7 @@ amdgpu_vm_tlb_flush(struct
amdgpu_vm_update_params*params,Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1}/* Prepare a TLB flush fence to be attached to PTs */ -if (!params->unlocked && vm->is_compute_context) { +if (!params->unlocked) {amdgpu_vm_tlb_fence_create (params->adev, vm, fence);/* Makes sure no PD/PT is freed before the flush */
Christian König
maintainerQuoted 18 lines · Prike
[Public]
Regards,
PrikeQuoted 13 lines
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 5, 2025 8:50 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: attach tlb fence to the PTs updateQuoted 3 lines · Prike Liang
Ensure the userq TLB flush is emitted only after the VM update finishes and the PT BOs have been annotated with bookkeeping fences.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Suggested-by Christian König <[email protected]>Signed-off-by Prike Liang <[email protected]>Reviewed-by Christian König <[email protected]>Could be that people start to complain that this results in extra overhead, but that shouldn't be much of an issue.
If without sorting the userq or KFD compute context, maybe overhead on legacy kernel queue case?
Yes, starting a worker all the time is not that much overhead but checking all the VMIDs for the PASID is.
We could make it depend on the HW generation if that really becomes a problem.
Regards,
Christian.
Quoted 24 lines
Quoted 23 lines
Regards,
Christian.drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct
Quoted 10 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -1062,7 +1062,7 @@ amdgpu_vm_tlb_flush(struct
amdgpu_vm_update_params*params,Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1}/* Prepare a TLB flush fence to be attached to PTs */ -if (!params->unlocked && vm->is_compute_context) { +if (!params->unlocked) {amdgpu_vm_tlb_fence_create (params->adev, vm, fence);/* Makes sure no PD/PT is freed before the flush */