[Cbe-oss-dev] [PATCH 1/2] [POWERPC] spufs: fix context destruction during psmap fault

Christoph Hellwig hch at lst.de
Mon Mar 3 15:30:05 EST 2008


On Thu, Feb 28, 2008 at 10:51:26AM +1100, Jeremy Kerr wrote:
> We have a small window where a spu context may be destroyed while
> we're servicing a page fault (from another thread) to the context's
> problem state mapping.
> 
> After we up_read() the mmap_sem, it's possible that the context is
> destroyed by its owning thread, and so the later references to ctx
> are invalid. This can maifest as a deadlock on the (now free()-ed)
> context state mutex.
> 
> This change adds a reference to the context before we release the
> mmap_sem, so that the context cannot be destroyed.

Doh, this is something lockdep would have caught if we had a working
powerpc port..

Patch looks good to me.



More information about the cbe-oss-dev mailing list