[Cbe-oss-dev] [CVS sw] * Updated version of the 6 previous affinity patches, with changes related

Arnd Bergmann arnd at arndb.de
Mon Mar 26 07:58:37 EST 2007


On Friday 23 March 2007, Luke Browning wrote:
> Here's a solution that may be more than you want.  It provides locking
> around the assignment of the context to the spu structure.  It doesn't 
> provide a full solution to the NOSCHED - Affinity problem, because there
> is still a race condition in the allocation of NOSCHED context and the
> assignment of the context to an spu for scheduling purposes.  It is a 
> first step towards a solution.  I don't think that you can come up with
> a solution to the larger problem based solely on atomic primitives.
> This patch avoids the immediate problem of taking a data storage
> interrupt for a non-protected reference. 

After thinking about the problem some more, I have come to the conclusion
that the bug is not just limited to the affinity code, but probably
present in other places of the code as well.

I haven't tried if it's possible, but I think the ideal solution would
be to get rid of the spu->ctx pointer entirely, as any user of it
is inherently racy, or it comes from code that already knows ctx.

We already copy a few variables around between ctx and spu, and there
may need to be more of those, which is a pain to maintain as well.

	Arnd <><



More information about the cbe-oss-dev mailing list