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

Christoph Hellwig hch at lst.de
Fri Jul 13 22:45:02 EST 2007


On Fri, Jul 13, 2007 at 10:34:50PM +1000, Benjamin Herrenschmidt wrote:
> 
> > > +		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 ?

not really.  We set a flag on the context to make sure some action is
performed when it comes through spu_run the next time.  It's not exactly
elegant, but cleaning this up will have to wait for the grand spu_run
rewrite.




More information about the Linuxppc-dev mailing list