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

Arnd Bergmann arnd at arndb.de
Mon Mar 3 15:25:17 EST 2008


On Monday 03 March 2008, Jeremy Kerr wrote:
> > But, I was speaking generally.  The forget code shouldn't have to
> > care about where a context is or is not.
> 
> I disagree. spu_forget is only supposed to be called in a context 
> destruction path, to dissocate the context from its mm. It should never 
> be called with a spu that is somehow going to be run.
> 
> So, having to take the context out of the run queue would mean we have a 
> bug.

Right, I agree. The reason why we have the spu_forget code is to have a
safe way of destroying the references to the mm, which must not happen
as long as we are still in spu_run, which is prevented by the fget()
in sys_spu_run. The implicit assumption is that we never try to load
a context that is not inside of spu_run. We used to do that from
spufs_ps_nopfn and spufs_mfc_write, which consequently were checking the
ctx->mm pointer, but the current code does not do it, and I don't see
a reason why we would want that again.

	Arnd <><



More information about the cbe-oss-dev mailing list