lkml.org 
[lkml]   [2006]   [Mar]   [3]   [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:
>>
>> Oleg Nesterov <oleg@tv-sign.ru> writes:
>>
>> > 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.
>>
>> 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.
>
> Yes, this is a problem. Please see the new version below. Instead of delaying
> pid releasing, free_pidmap() just invalidates pid_ref. The code becomes even
> simpler.

And it removes most of my interaction problem with multiple pid spaces.

>> Your resource consumption with the extra hash table is higher than
>> mine at until very high process counts.
>
> The size of ref_array[] could be arbitrary low (we can't use pid_hashfn() in
> this case, of course). And tref adds 4 * sizeof(void*) to every task, and it
> is much more complicated.

I guess the worst case behavior would be triggered by a find in /proc.
Which would probably populate a ref for every pid, and it isn't that
uncommon. So I suspect we really want to make ref_array be able to
use pid hashfn as it is likely to get an equal amount of use.

More comments when I have time.

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-03 18:53    [W:0.697 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site