[Cbe-oss-dev] [PATCH 4/6] spufs: extension of spu_create to support affinity definition

André Detsch adetsch at br.ibm.com
Thu Feb 15 02:55:23 EST 2007


Arnd Bergmann wrote:
> On Monday 12 February 2007 02:14, Andre Detsch wrote:
>> Affinity is represented as a doubly linked list of spu_contexts.
> 
> I couldn't see a place where you get a reference count for the contexts
> you link to each other. Have you checked that this is safe to do?
> Did I miss something there?

I don't think reference counting is required here. As I see, affinity 
links fall on the same case of gang->list links (that do not change the 
contexts reference counters).
Also, affinity links are created only when the context is (already) 
within a gang, and the links are reset on spu_gang_remove_ctx (where 
ctx->gang_list pointers are also reset). So, if it is safe to access the 
contexts through gang->list, affinity links are also safe.

Please correct me if this is not ok.

--
Andre Detsch




More information about the cbe-oss-dev mailing list