[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aTai1a2sFqTh7wv9@redhat.com>
Date: Mon, 8 Dec 2025 11:05:09 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Christian König <christian.koenig@....com>
Cc: Todd Kjos <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joelagnelf@...dia.com>,
Christian Brauner <brauner@...nel.org>,
Carlos Llamas <cmllamas@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Felix Kuehling <Felix.Kuehling@....com>,
Alex Deucher <alexander.deucher@....com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Boris Brezillon <boris.brezillon@...labora.com>,
Rob Herring <robh@...nel.org>, Steven Price <steven.price@....com>,
Adrián Larumbe <adrian.larumbe@...labora.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Liviu Dudau <liviu.dudau@....com>, Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 4/7] drm/amd: kill the outdated "Only the pthreads
threading model is supported" checks
On 12/08, Christian König wrote:
>
> On 12/7/25 13:39, Oleg Nesterov wrote:
> > Nowaday task->group_leader->mm != task->mm is only possible if
> > a) task is not a group leader and b) task->group_leader->mm == NULL
> > because task->group_leader has already exited using sys_exit().
>
> Just for my understanding: That is because CLONE_THREAD can only be
> specified together with CLONE_SIGHAND and CLONE_VM, correct?
Yes, copy copy_process() does
if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
return ERR_PTR(-EINVAL);
if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
return ERR_PTR(-EINVAL);
...
if (clone_flags & CLONE_THREAD) {
p->group_leader = current->group_leader;
p->tgid = current->tgid;
} else {
p->group_leader = p;
p->tgid = p->pid;
}
> Reviewed-by: Christian König <christian.koenig@....com>
Thanks!
> Should we pick that one up or do you want to merge it upstream somehow?
If you don't object, I would like to route this series via -mm tree.
See 0/7, I am going to send more (simple) tree-wide changes which depend
on this series.
Oleg.
> Regards,
> Christian.
>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ---
> > drivers/gpu/drm/amd/amdkfd/kfd_process.c | 10 ----------
> > 2 files changed, 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > index a0f8ba382b9e..e44f158a11f0 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > @@ -2551,9 +2551,6 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
> > vm->task_info->task.pid = current->pid;
> > get_task_comm(vm->task_info->task.comm, current);
> >
> > - if (current->group_leader->mm != current->mm)
> > - return;
> > -
> > vm->task_info->tgid = current->tgid;
> > get_task_comm(vm->task_info->process_name, current->group_leader);
> > }
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> > index a085faac9fe1..f8ef18a3aa71 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> > @@ -833,12 +833,6 @@ struct kfd_process *kfd_create_process(struct task_struct *thread)
> > if (!(thread->mm && mmget_not_zero(thread->mm)))
> > return ERR_PTR(-EINVAL);
> >
> > - /* Only the pthreads threading model is supported. */
> > - if (thread->group_leader->mm != thread->mm) {
> > - mmput(thread->mm);
> > - return ERR_PTR(-EINVAL);
> > - }
> > -
> > /* If the process just called exec(3), it is possible that the
> > * cleanup of the kfd_process (following the release of the mm
> > * of the old process image) is still in the cleanup work queue.
> > @@ -918,10 +912,6 @@ struct kfd_process *kfd_get_process(const struct task_struct *thread)
> > if (!thread->mm)
> > return ERR_PTR(-EINVAL);
> >
> > - /* Only the pthreads threading model is supported. */
> > - if (thread->group_leader->mm != thread->mm)
> > - return ERR_PTR(-EINVAL);
> > -
> > process = find_process(thread, false);
> > if (!process)
> > return ERR_PTR(-EINVAL);
>
Powered by blists - more mailing lists