Re: kernel thread exit race

From: Nikita Danilov (Nikita@Namesys.COM)
Date: Wed Aug 07 2002 - 06:30:17 EST

Alan Cox writes:
> On Wed, 2002-08-07 at 11:05, Nikita Danilov wrote:
> > Ah I see, thank you and Russell. But this depends on no architecture
> > ever accessing spinlock data after letting waiters to run, otherwise
> > there still is (tiny) window for race at the end of complete() call,
> > right?
> complete() as opposed to spinlocks/semaphores is defined to be safe to
> free the object once the complete finishes

So, complete() is not-arch dependent because spinlocks are "good" in all
architectures? complete() ends with spin_unlock_irqrestore() so it
cannot be any better than spinlocks, until there is some hidden magic.

Let me clarify this. Suppose there is some obscure architecture that
maintains in spinlocks some additional data for debugging. Then,


"wakes up" thread on another CPU and proceeds to access spin-lock data
(to check/update debugging information, for example), but by this time
woken up thread manages to unload module and to un-map page containing
spin-lock data.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:35 EST