[lkml]   [2006]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC] ps command race fix
    On Mon, 24 Jul 2006 19:33:18 -0700
    Andrew Morton <> wrote:

    > On Tue, 25 Jul 2006 11:08:35 +0900
    > KAMEZAWA Hiroyuki <> wrote:
    > > > Then the seek and read and such semantics are nice and stable and
    > > > simple.
    > > >
    > > yes...
    > > I think snapshot at open() is okay.
    > We cannot do a single kmalloc() like cpuset does.
    > The kernel presently kind-of guarantees that a 32k kmalloc() will work,
    > although the VM might have to do very large amounts of work to achieve it.
    > But 32k is only 8192 processes, so a snapshot will need multiple
    > allocations and a list and trouble dropping and retaking tasklist_lock to
    > allocate memory and keeping things stable while doing that. I suspect
    > it'll end up ugly.

    Hm, how about using bitmap instead of table ? (we'll have many holes but...)
    - sytem-wide bitmap of used tgid which is updated only when /proc is opened
    seems not to be much problem. 32k kmalloc can store 256k pids.

    BTW, how large pids and how many proccess in a (heavy and big) system ?


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-07-25 04:49    [W:0.021 / U:2.880 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site