Re: [patch] exit_free(), 2.5.31-A0

From: Ingo Molnar (mingo@elte.hu)
Date: Tue Aug 13 2002 - 13:03:52 EST


On Tue, 13 Aug 2002, Linus Torvalds wrote:

> > we dont really want any signal overhead, and we also dont want any extra
> > context-switching to the 'master thread'. And there's no master thread
> > anymore either.
>
> That still doesn't make it any les crap: because any thread that exits
> without calling the "magic exit-flag interface" will then silently be
> lost, with no information left around anywhere.

that should be a pretty rare occurance: with the upcoming signals patch
any segmentation fault zaps all threads and does a proper (and
deadlock-free) multithreaded coredump. Sysadmin doing a kill(1) will get
all threads killed as well. The only possible way for an uncontrolled exit
is for the thread to call sys_exit() explicitly (which is not possible
without the glibc cleanup handlers being called), or for someone to send a
SIGKILL via sys_tkill().

but even in this rare and malicious case, whatever resources a thread has,
they are lost if there's an uncontrolled exit anyway. There's tons of
other stuff that glibc might have to clean up on exit - mutexes,
malloc()s, etc. Thread exit needs to be cooperative, no matter what. The
stack cache does not change this situation the least.

        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:33 EST