Re: heavy handed exit() in latest BK

Linus Torvalds (torvalds@transmeta.com)
Sun, 9 Feb 2003 17:07:01 -0800 (PST)


On Sun, 9 Feb 2003, Roland McGrath wrote:
>
> There is a similar failure to take the lock before using zap_other_threads.
> I thought I sent this patch before, but it's not in 2.5 yet.

Hmm.. From looking at this patch, it seems as if you believe that
spinlocks must next correctly. They don't have to.

The ABBA kind of deadlock only means that you have to _take_ the spinlocks
in the right order, you can release them in any order you like (as long as
you release all of them).

So if the only requirement is that zap_other_threads() is called with the
tasklist lock held, I would suggest just dropping the tasklist lock after
the zap_other threads thing, despite the fact that you still want to hold
on to the siglock for a while longer. That simplifies the patch, and means
that you don't have to worry about dropping and re-taking the tasklist
lock in the loop that follows.

Linus

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