> On 04/16, David Howells wrote:
> >
> > Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > > - Fix the comment, is_single_threaded(p) actually means that nobody shares
> > > ->mm with p.
> > >
> > > I think this helper should be renamed,
> >
> > What we want to know when we ask this function is whether or not a process is
> > single-threaded, hence the name. The fact that because:
> >
> > CLONE_THREAD => CLONE_SIGHAND => CLONE_VM
> >
> > we can work this out purely by checking that there aren't any processes that
> > share VM space with us is immaterial.
>
> Confused... I already asked this in
http://marc.info/?t=123853355800001
> "what is_single_threaded() does?" and perhaps I misunderstood you.
>
> So, once again, what it should do? If we only care about CLONE_THREAD (implies
> CLONE_VM), then we can just do
>
> bool is_single_threaded(struct task_struct *p)
> {
> return atomic_read(&p->signal->live) == 1;
> }
>
> But, if it should check p doesn't share VM space (this is what it does
> with or without the patch), then we have to scan all processes.