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

Arnd Bergmann arnd.bergmann at de.ibm.com
Sat Mar 17 02:17:01 EST 2007

On Thursday 22 February 2007, Andre Detsch <adetsch at br.ibm.com> wrote:
> ++static inline int sched_spu(struct spu *spu)
> ++{
> ++      return (!spu->ctx || !(spu->ctx->flags & SPU_CREATE_NOSCHED));
> ++}
> ++

While looking through the code in 2.6.21-rc3-arnd1, I stumbled over this
chunk of code which was never reviewed afaict. Unfortunately, it
introduced a nasty bug, since it accesses the context of another spu,
without holding any lock whatsoever.

Andre, please find another way to determine this, my guess is that
the easiest way is to add a flag to struct spu that has information
about whether it is schedulable or not.

A minor problem in this function that should be solved at the
same time is that spus that have been allocated by another module
(not spufs) are counted as schedulable when they are not.
Since we don't have such other drivers at the moment, it doesn't
show up fortunately.

	Arnd <><

More information about the cbe-oss-dev mailing list