lkml.org 
[lkml]   [2006]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 01/23] tref: Implement task references.
    From
    Date
    Oleg Nesterov <oleg@tv-sign.ru> writes:

    > Eric W. Biederman wrote:
    >>
    >> Holding a reference to a task_struct pins about 10K of low memory even after
    >> that task has exited. Which seems to be at 1 or 2 orders of mangnitude more
    >> memory than any other data structure in the kernel. Not holding a reference
    >> to a task_struct and you risk problems with pid wrap around.
    >
    > I think there is another, much simpler solution. We can make a "reference" to
    > the
    > pid itself to protect it against free_pidmap(), so that this pid can't be
    > reused.

    I kind of like the idea of not releasing the pid when someone is using it.
    However with my trivial hostile program I can with 32 or 33 living processes
    each with 1000 references to dead processes I can completely saturate the
    default pid map. And it won't be obvious why alloc_pidmap is failing.

    Your resource consumption with the extra hash table is higher than
    mine at until very high process counts.

    In addition it doesn't really help with the problem that inspired
    this work. That of having multiple pid spaces. I could make it work
    by throwing a pspace reference in struct pid_ref, but without some
    fancy footwork it would prevent cleanup until all of the outside
    references are gone.

    > What do you think?

    So I kind of like it but I don't feel it does as good a job solving
    the problems I am solving.

    In this instance I'm not at all certain I like having NULL ref
    pointers. It increases the number of cases you have to deal with when
    reading back the pid, but that is minor and something task_refs suffer
    from more than pid_refs.

    Eric
    -
    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: 2006-03-02 23:24    [W:4.008 / U:0.260 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site