Re: [PATCH] processes with shared vm

Dave McCracken (dmccr@us.ibm.com)
Fri, 17 Aug 2001 09:26:10 -0500


--On Friday, August 17, 2001 10:46:59 +0200 Terje Eggestad
<terje.eggestad@scali.no> wrote:

> hought of all that, yes ps will have O(n^2) BUT ONLY FOR CLONED PROCS.
> How many cloned procs do you usually have????
>
> Even if I agree that there should be a linked list of all the cloned
> procs, it means major changes to the data structs in the kernel.
>
> With the number of threaded programs out there, this is "good enough".

There is a simpler way to do this. All tasks belong to a thread group, and
while thread groups are connected via a different clone flag
(CLONE_THREAD), in practice CLONE_THREAD and CLONE_VM are generally used
together. It would be trivial to add TGID to the information in /proc,
then assume all tasks with the same TGID have the same VM as well. It
would be just one more line in the /proc output and not require any
additional overhead.

Dave McCracken

======================================================================
Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059
dmccr@us.ibm.com T/L 678-3059

-
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/