[Cbe-oss-dev] [PATCH] spufs: don't requeue victim contex in find_victim if it's not in spu_run

Christoph Hellwig hch at lst.de
Wed May 7 20:24:13 EST 2008


We should not requeue the victim context in find_victim if the owner is
not in spu_run.  It's first not needed because leaving the context on
the spu is an optimization and second is harmful because it means the
owner could re-enter spu_run when the context is on the runqueue and
trip the BUG_ON in __spu_update_sched_info.


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/sched.c	2008-05-02 11:15:12.000000000 +0200
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c	2008-05-02 11:15:30.000000000 +0200
@@ -657,7 +657,8 @@ static struct spu *find_victim(struct sp
 
 			victim->stats.invol_ctx_switch++;
 			spu->stats.invol_ctx_switch++;
-			spu_add_to_rq(victim);
+			if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
+				spu_add_to_rq(victim);
 
 			mutex_unlock(&victim->state_mutex);
 



More information about the cbe-oss-dev mailing list