[PATCH 1/2] Enable SPU switch notification to detect currently active SPU tasks.

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Jul 13 22:34:50 EST 2007


> > +		if (unlikely(test_bit(SPU_SCHED_NOTIFY_ACTIVE,
> > +				      &ctx->sched_flags))) {
> > +			clear_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags);
> 
> this should use test_and_clear_bit

This also looks like an abuse of atomics to effectively implement a lock
or did I miss something ?

Ben.





More information about the Linuxppc-dev mailing list