[Cbe-oss-dev] Lifetime of SPE contexts & gangs

Michael Ellerman michael at ellerman.id.au
Wed May 9 15:14:56 EST 2007


On Wed, 2007-05-09 at 14:45 +1000, Jeremy Kerr wrote:
> Hi all,
> 
> I'm in the process of sorting out the issues we have with SPE gangs and 
> contexts in spufs at the moment. For those that haven't come across 
> this, if a process destroy a gang (ie, close its file descriptor) 
> before destroying the gang's contexts, we hit a bug, mostly because we 
> haven't set any explicit behaviour for this condition.
> 
> So, there are a couple of possible approaches to correct this:
> 
> * Each context within a gang holds a reference to the gang via the 
> gang's refcount, and closing the gang fd decreases it. So, if you close 
> the gang fd, the gang dir only gets removed when the last context is 
> destroyed.
> 
> * Closing a gang causes the gang's contexts to be destroyed at the same 
> time, regardless of whether the process holds an open file descriptor 
> to any of the contexts.
> 
> * Destroying the gang causes its contexts to be reparented to the root 
> of the spu filesystem. Libspe might get a little confused by this 
> though..

I like this idea best .. because I thought of it perhaps :)  Why would
libspe get confused? Because it remembers the path or something?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20070509/f78d3aca/attachment.pgp>


More information about the cbe-oss-dev mailing list