[Cbe-oss-dev] [PATCH] spufs: fix race condition on gang->aff_ref_spu

Christoph Hellwig hch at lst.de
Thu Aug 16 11:54:41 EST 2007


On Wed, Aug 15, 2007 at 05:50:03PM -0300, Andre Detsch wrote:
> Subject: spufs: fix race condition on gang->aff_ref_spu
> 
> From: Andre Detsch <adetsch at br.ibm.com>
> 
> Affinity reference point location (gang->aff_ref_spu) is reset
> when the whole gang is descheduled. However, the last member of
> a gang can be descheduled while we are trying to schedule another
> member of the gang. This was leading to a race condition, and
> the code was using gang->aff_ref_spu in an unsafe manner.
> 
> By holding the gang->aff_mutex a little bit longer, and increment
> gang->aff_sched_count (which controls when gang->aff_ref_spu
> should be reset) a little bit earlier, the problem is fixed.

Looks good.




More information about the cbe-oss-dev mailing list