[Devel] Re: [PATCH] cgroups: skip processes from other namespaces when listing a cgroup

Dave Hansen dave at linux.vnet.ibm.com
Mon Dec 8 08:31:29 PST 2008


On Mon, 2008-12-08 at 20:44 +0530, Balbir Singh wrote:
> * gowrishankar <gomuthuk at linux.vnet.ibm.com> [2008-12-07 20:16:01]:
> >     struct cgroup_iter it;
> >     struct task_struct *tsk;
> >     cgroup_iter_start(cgrp, &it);
> >     while ((tsk = cgroup_iter_next(cgrp, &it))) {
> >         if (unlikely(n == npids))
> >             break;
> > -        pidarray[n++] = task_pid_vnr(tsk);
> > +        if ((vpid = task_pid_vnr(tsk)) > 0)
> > +            pidarray[n++] = vpid;
> >     }
> >     cgroup_iter_end(cgrp, &it);
> >     return n;

One more thing...

Please cc Eric and Suka on patches like this.  If we get many users like
this we'll probably want to add some common function.  Or if someone
missed using one, they can probably suggest one.

-- Dave

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list