[Cbe-oss-dev] [PATCH 2/2] [POWERPC] spufs: fix invalid scheduling of forgotten contexts

Luke Browning lukebr at linux.vnet.ibm.com
Fri Feb 29 21:43:36 EST 2008


On Fri, 2008-02-29 at 13:49 +1100, Jeremy Kerr wrote:
> Hi Luke,
> 
> > I think that you should unconditionally call spu_deactivate(),
> > because the context may be on the runqueue.
> 
> The context shouldn't be on the runqueue, because that would mean that a 
> thread is in spu_run(), which does a fget_light() on the context fd, 
> which then cannot be destroyed, so spu_forget won't get called.
> 
> Or am I missing something

The context could be time sliced while in user mode, if it was lazily
loaded.  If there is not another context on run queue, when the yield at
the end of spu_run is run, the context remains loaded.  We both
submitted patches for this recently.

But, I was speaking generally.  The forget code shouldn't have to care
about where a context is or is not.  It should just deactivate it.
Where a context is and the conditions that govern it is something that
can change overtime.  Forget shouldn't look at context state as we may
add new states over time or the significance of a state may change.  The
architected meaning of the deactivate routine is that all internal
dependencies on the context will be removed and it will not be activated
again until the caller explicitly invokes activate.  This is what forget
is supposed to produce.  

Cheers,
Luke





More information about the cbe-oss-dev mailing list