diff options
author | Felix Kuehling | 2017-11-28 00:29:52 +0100 |
---|---|---|
committer | Oded Gabbay | 2017-11-28 00:29:52 +0100 |
commit | abb208a8d490bac9d765c45f20cf306757733778 (patch) | |
tree | 25b52459315bb9a40411bfa15af7446424435245 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h | |
parent | drm/amdkfd: Make kfd_process reference counted (diff) | |
download | kernel-qcow2-linux-abb208a8d490bac9d765c45f20cf306757733778.tar.gz kernel-qcow2-linux-abb208a8d490bac9d765c45f20cf306757733778.tar.xz kernel-qcow2-linux-abb208a8d490bac9d765c45f20cf306757733778.zip |
drm/amdkfd: Use ref count to prevent kfd_process destruction
Use a reference counter instead of a lock to prevent process
destruction while functions running out of process context are using
the kfd_process structure. In many cases these functions don't need
the structure to be locked. In the few cases that really do need the
process lock, take it explicitly.
This helps simplify lock dependencies between the process lock and
other locks, particularly amdgpu and mm_struct locks. This will be
important when amdgpu calls back to amdkfd for memory evictions.
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 248e4f510824..0c96a6b3a173 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -606,6 +606,7 @@ void kfd_process_destroy_wq(void); struct kfd_process *kfd_create_process(struct file *filep); struct kfd_process *kfd_get_process(const struct task_struct *); struct kfd_process *kfd_lookup_process_by_pasid(unsigned int pasid); +void kfd_unref_process(struct kfd_process *p); struct kfd_process_device *kfd_bind_process_to_device(struct kfd_dev *dev, struct kfd_process *p); |