Re: [PATCH 01/23] tref: Implement task references.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oleg Nesterov <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux