Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdkfd: start using tlb_seq from the VM subsystem

Instead of trying to figure out if a TLB flush is necessary or not use
the information provided by the VM subsystem now.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Philip Yang<Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
bffa91da 5255e146

+8
+1
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
··· 705 705 /* VM context for GPUVM allocations */ 706 706 struct file *drm_file; 707 707 void *drm_priv; 708 + uint64_t tlb_seq; 708 709 709 710 /* GPUVM allocations storage */ 710 711 struct idr alloc_idr;
+7
drivers/gpu/drm/amd/amdkfd/kfd_process.c
··· 1560 1560 return ret; 1561 1561 } 1562 1562 pdd->drm_priv = drm_file->private_data; 1563 + pdd->tlb_seq = 0; 1563 1564 1564 1565 ret = kfd_process_device_reserve_ib_mem(pdd); 1565 1566 if (ret) ··· 1950 1949 1951 1950 void kfd_flush_tlb(struct kfd_process_device *pdd, enum TLB_FLUSH_TYPE type) 1952 1951 { 1952 + struct amdgpu_vm *vm = drm_priv_to_vm(pdd->drm_priv); 1953 + uint64_t tlb_seq = amdgpu_vm_tlb_seq(vm); 1953 1954 struct kfd_dev *dev = pdd->dev; 1954 1955 1956 + if (pdd->tlb_seq == tlb_seq) 1957 + return; 1958 + 1959 + pdd->tlb_seq = tlb_seq; 1955 1960 if (dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS) { 1956 1961 /* Nothing to flush until a VMID is assigned, which 1957 1962 * only happens when the first queue is created.