lkml.org 
[lkml]   [2009]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/4] CGroup: Support for named and empty hierarchies
On Wed, 22 Jul 2009 22:37:53 -0700
Paul Menage <menage@google.com> wrote:

> On Wed, Jul 22, 2009 at 10:13 PM, KAMEZAWA
> Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> >
> > Thank you. I'd like to look into procps package to allow
> >
> >  #ps -lf -cgroup=/xxxx/yyy
> > or
> >  #top -cgroup=/xxx/yyy
> >
>
> Wouldn't it be less invasive to change procps so that doing
>
> ps <pid1> <pid2> ...
>
> only actually looks at /proc/<pid1>, /proc/<pid2>, etc, rather than
> looking at all of them and then throwing away any that aren't in the
> supplied list?
>
> Then you could do what you want with ps $(cat /dev/cgroup/xxxx/yyy/tasks)
>
Good point. When you try strace

#strace ps -ef --pid XXXX

you'll see ps scan all pids. The same behavior for pkill, pgrep etc...
AFAIK, this is a behavior from Linux 2.4 ages.
By this, ps -ef --pid=XXX can take 1ms if 2000 procs are on system.
# I think this is because ps uses an unified filter routine.

So, I have to rewrite filter routine or add cgroup support.

Abyway, adding a new toggle switch to "top", "pgrep" is worth to do, I think.

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-07-23 07:49    [W:0.036 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site