Thread (17 messages) 17 messages, 7 authors, 2025-12-21

Re: [PATCH 3/7] drm/amdgpu: don't abuse current->group_leader

From: Felix Kuehling <felix.kuehling@amd.com>
Date: 2025-12-09 19:22:59
Also in: amd-gfx, dri-devel, linux-rdma, lkml

On 2025-12-07 07:39, Oleg Nesterov wrote:
Cleanup and preparation to simplify the next changes.

- Use current->tgid instead of current->group_leader->pid

- Use get_task_pid(current, PIDTYPE_TGID) instead of
   get_task_pid(current->group_leader, PIDTYPE_PID)

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Felix Kuehling <felix.kuehling@amd.com>

quoted hunk ↗ jump to hunk
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c           | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index b1c24c8fa686..df22b54ba346 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1421,7 +1421,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
  			goto create_evict_fence_fail;
  		}
  
-		info->pid = get_task_pid(current->group_leader, PIDTYPE_PID);
+		info->pid = get_task_pid(current, PIDTYPE_TGID);
  		INIT_DELAYED_WORK(&info->restore_userptr_work,
  				  amdgpu_amdkfd_restore_userptr_worker);
  
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index a67285118c37..a0f8ba382b9e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2554,7 +2554,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
  	if (current->group_leader->mm != current->mm)
  		return;
  
-	vm->task_info->tgid = current->group_leader->pid;
+	vm->task_info->tgid = current->tgid;
  	get_task_comm(vm->task_info->process_name, current->group_leader);
  }
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help