lkml.org 
[lkml]   [2021]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 1/2] mm: introduce process_mrelease system call
On Fri 06-08-21 02:23:17, Shakeel Butt wrote:
> On Thu, Aug 5, 2021 at 11:40 PM Michal Hocko <mhocko@suse.com> wrote:
> >
> [...]
> > I think you really want something like this:
> >
> > if (flags)
> > return -EINVAL;
> >
> > pid = pidfd_get_pid(fd, &f_flags);
> > if (IS_ERR(pid))
> > return PTR_ERR(pid);
> > task = get_pid_task(pid, PIDTYPE_PID);
> > if (!task) {
> > ret = -ESRCH;
> > goto put_pid;
> > }
> >
> > /*
> > * Make sure to chose a thread which still has a reference to mm
> > * during the group exit
> > */
> > p = find_lock_task_mm(task);
> > if (!p) {
> > ret = -ESRCH;
> > goto put_task;
> > }
> >
> > mm = task->mm;
>
> mm = p->mm;

right. Thanks!

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-08-06 12:15    [W:0.080 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site