Re: [patch] user-vm-unlock-2.5.31-A2

From: Ingo Molnar (mingo@elte.hu)
Date: Thu Aug 15 2002 - 18:58:24 EST


On Thu, 15 Aug 2002, Linus Torvalds wrote:

> > we could skip the 'clear' bit if this is the last release of the mm.
>
> Ahhah, but you miss the point.
>
> The fork()'ed child may clone on its own, and then exit. [...]

i was actually thinking about exactly this scenario when suggesting this.
The fork()ed child might as well end up being a 'thread' that exits and
thus needs to clear up after itself, right?

> [...] In which case we sure as heck don't want the original child to
> modify the VM that it now shares with a subthread.

in what way is clone() utilized? if it's via any threading library then
the fork()-ed process has its own thread state, which must be freed when
exiting. So it's something like:

        thread X
        fork() ===============> thread Y
                                          clone() ===========> thread Z

so we at this point have the original thread X, a new thread Y that was
created via the fork(), and thread Z. Thread Y and Z share the same V. If
now thread Y exits:

                                           exit()

then we'd sure expect for Z's sake to free Y's thread state, right?
Otherwise there would be a resource leak.

[ but it's getting late here and i might miss something :) ]

        Ingo

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



This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:41 EST